From 40bcb6a789bcb9439f227041bc7708f40cc6e050 Mon Sep 17 00:00:00 2001 From: Thorsten Suckow-Homberg Date: Wed, 9 Nov 2022 19:41:45 +0100 Subject: [PATCH] Revert "refactor: transform only first parent into resource linkage" This reverts commit 7b4dd583a2dfa307e2d85df09111ab39787c2227. --- _composer.lock | 7367 ----------------- composer.json | 9 +- composer.lock | 3406 +++----- phpstan.neon | 5 - src/Core/AbstractList.php | 304 - src/Core/Contract/Comparable.php | 50 - src/Core/Contract/Equatable.php | 51 - src/Core/Contract/StringStrategy.php | 48 - src/Core/Contract/StringVisitor.php | 48 - src/Core/Exception/ClassNotFoundException.php | 39 - src/Core/Exception/InvalidTypeException.php | 39 - .../Exception/UnexpectedTypeException.php | 39 - src/{Data => Core}/ParameterBag.php | 14 +- src/{Data/Resource => Core}/ResourceQuery.php | 66 +- src/Core/Util/ClassLoader.php | 87 - src/Data/Filter/Filter.php | 83 - src/Data/Resource/ObjectDescription.php | 219 - src/Data/Resource/ObjectDescriptionList.php | 48 - src/Data/Sort/SortInfo.php | 110 - src/Data/Sort/SortInfoList.php | 87 - src/Data/Validation/Rule.php | 57 - src/Data/Validation/ValidationError.php | 48 - src/Data/Validation/ValidationErrors.php | 57 - src/Data/Validation/Validator.php | 53 - src/Error/AbstractError.php | 107 - src/Error/AnonymousErrorSource.php | 92 - src/Error/ErrorObject.php | 58 - src/Error/ErrorObjectList.php | 73 - src/Error/ErrorSource.php | 54 - .../Mail/Client/Imap}/AttachmentTrait.php | 22 +- .../Mail/Client/Imap/AttributeTrait.php} | 96 +- src/Horde/Mail/Client/Imap/FilterTrait.php | 97 + .../Mail/Client/Imap}/HordeClient.php | 587 +- .../Composer/HordeAttachmentComposer.php | 8 +- .../Message}/Composer/HordeBodyComposer.php | 8 +- .../Message}/Composer/HordeHeaderComposer.php | 20 +- src/Horde_Imap/Client/FilterTrait.php | 133 - src/Horde_Imap/Client/SortInfoStrategy.php | 102 - src/Http/Exception/BadRequestException.php | 5 +- src/Http/Exception/ForbiddenException.php | 44 - .../InternalServerErrorException.php | 5 +- .../Exception/MethodNotAllowedException.php | 44 - src/Http/Exception/NotFoundException.php | 44 - src/Http/Exception/UnauthorizedException.php | 44 - .../Json/Problem}/AbstractProblem.php | 84 +- .../Json/Problem}/BadRequestProblem.php | 4 +- .../Problem}/InternalServerErrorProblem.php | 4 +- .../Json/Problem}/MethodNotAllowedProblem.php | 4 +- .../Json/Problem}/Problem.php | 2 +- .../Json/Problem}/ProblemFactory.php | 33 +- .../Json/Problem}/README.md | 2 +- .../InvalidParameterResourceException.php} | 16 +- .../Query}/InvalidQueryException.php | 12 +- .../Query}/InvalidQueryParameterException.php | 11 +- src/Http/Query/QueryTranslator.php | 126 + src/Http/Request.php | 114 - src/Http/RequestMethod.php | 94 - src/Http/{ => Status}/StatusCodes.php | 26 +- src/Illuminate/Auth/Imap/ImapUser.php | 2 +- src/Illuminate/Auth/Imap/Util.php | 2 +- .../LaravelAttachmentListJsonTransformer.php | 10 +- .../Validation/Parameter/RelfieldRule.php | 143 - src/JsonApi/Query/Query.php | 67 - .../Query/Validation/CollectionValidator.php | 124 - .../Validation/Parameter/FieldsetRule.php | 252 - .../Validation/Parameter/IncludeRule.php | 107 - .../Validation/Parameter/PnFilterRule.php | 204 - .../Query/Validation/Query/QueryRule.php | 46 - src/JsonApi/Query/Validation/Validator.php | 191 - src/JsonApi/Request.php | 96 - src/JsonApi/Resource/Resource.php | 45 - src/JsonApi/Resource/ResourceCollection.php | 37 - src/JsonApi/Resource/ResourceList.php | 92 - src/JsonApi/Resource/ResourceResolver.php | 98 - src/JsonProblem/ForbiddenProblem.php | 50 - src/JsonProblem/NotFoundProblem.php | 50 - src/JsonProblem/ProblemList.php | 72 - src/JsonProblem/UnauthorizedProblem.php | 50 - .../Client}/Attachment/AbstractAttachment.php | 12 +- .../Client}/Attachment/FileAttachment.php | 10 +- .../Client}/Attachment/FileAttachmentItem.php | 8 +- .../Attachment/FileAttachmentItemList.php | 10 +- .../Client}/Attachment/FileAttachmentList.php | 10 +- .../Processor/FileAttachmentProcessor.php | 8 +- .../Processor/InlineDataProcessor.php | 8 +- .../Processor/ProcessorException.php | 6 +- .../Data/CompoundKey/AttachmentKey.php | 4 +- .../Client}/Data/CompoundKey/CompoundKey.php | 25 +- .../Client}/Data/CompoundKey/FolderKey.php | 4 +- .../MessageItemChildCompoundKey.php | 10 +- .../Client}/Data/CompoundKey/MessageKey.php | 14 +- .../Client}/Data/DataException.php | 6 +- .../Client}/Data/MailAccount.php | 12 +- .../Client}/Data/MailAddress.php | 46 +- .../Client}/Data/MailAddressList.php | 51 +- .../Client}/Folder/AbstractMailFolder.php | 74 +- .../Client}/Folder/FolderIdToTypeMapper.php | 4 +- .../Client}/Folder/ListMailFolder.php | 9 +- .../Client}/Folder/MailFolder.php | 108 +- .../Client}/Folder/MailFolderChildList.php | 31 +- .../Client}/Folder/MailFolderList.php | 14 +- .../Tree/DefaultMailFolderTreeBuilder.php | 169 +- .../Folder/Tree/MailFolderTreeBuilder.php | 13 +- .../Client}/Imap/ImapClientException.php | 4 +- .../Imap/Util/DefaultFolderIdToTypeMapper.php | 30 +- .../Client}/MailClient.php | 121 +- .../Client}/MailClientException.php | 4 +- .../Client}/Message/AbstractMessageBody.php | 36 +- .../Client}/Message/AbstractMessageItem.php | 88 +- .../Message/Composer/AttachmentComposer.php | 6 +- .../Client}/Message/Composer/BodyComposer.php | 6 +- .../Message/Composer/HeaderComposer.php | 6 +- .../Client}/Message/Composer/README.md | 2 +- .../Client}/Message/DraftTrait.php | 6 +- .../Client}/Message/Flag/AbstractFlag.php | 4 +- .../Client}/Message/Flag/AnsweredFlag.php | 4 +- .../Client}/Message/Flag/DraftFlag.php | 4 +- .../Client}/Message/Flag/FlagList.php | 6 +- .../Client}/Message/Flag/FlaggedFlag.php | 4 +- .../Client}/Message/Flag/SeenFlag.php | 4 +- src/Mail/Client/Message/ListMessageItem.php | 136 + .../Client}/Message/MessageBody.php | 6 +- .../Client}/Message/MessageBodyDraft.php | 6 +- .../Client}/Message/MessageItem.php | 40 +- .../Client}/Message/MessageItemDraft.php | 56 +- .../Client}/Message/MessageItemList.php | 48 +- .../Client}/Message/MessagePart.php | 28 +- .../Client}/Message/README.md | 10 +- .../AbstractMessagePartContentProcessor.php | 11 +- .../DefaultMessageItemFieldsProcessor.php | 6 +- .../Text/DefaultPreviewTextProcessor.php | 8 +- .../Client}/Message/Text/HtmlTextStrategy.php | 4 +- .../Text/MessageItemFieldsProcessor.php | 6 +- .../Text/MessagePartContentProcessor.php | 6 +- .../Message/Text/PlainTextStrategy.php | 4 +- .../Message/Text/PreviewTextProcessor.php | 4 +- .../Message/Text/ProcessorException.php | 6 +- .../Query/MessageItemListResourceQuery.php} | 14 +- .../Reader/DefaultPlainReadableStrategy.php | 4 +- .../Client}/Reader/HtmlReadableStrategy.php | 6 +- .../Client}/Reader/PlainReadableStrategy.php | 6 +- .../Client}/Reader/PurifiedHtmlStrategy.php | 4 +- .../ReadableMessagePartContentProcessor.php | 6 +- .../AttachmentListJsonTransformer.php | 8 +- ...DefaultMessageBodyDraftJsonTransformer.php | 19 +- ...DefaultMessageItemDraftJsonTransformer.php | 18 +- .../MessageBodyDraftJsonTransformer.php | 8 +- .../MessageItemDraftJsonTransformer.php | 8 +- .../Client}/Service/AttachmentService.php | 14 +- .../Client}/Service/AuthService.php | 4 +- .../Service/DefaultAttachmentService.php | 16 +- .../Client}/Service/DefaultAuthService.php | 5 +- .../Service/DefaultMailFolderService.php | 19 +- .../Service/DefaultMessageItemService.php | 154 +- .../Client}/Service/MailFolderService.php | 13 +- .../Client}/Service/MessageItemService.php | 87 +- .../Client}/Service/ServiceException.php | 4 +- src/Mail/Client/Util/JsonApiStrategy.php | 90 + .../Writer/DefaultHtmlWritableStrategy.php | 4 +- .../Writer/DefaultPlainWritableStrategy.php | 4 +- .../Client}/Writer/HtmlWritableStrategy.php | 6 +- .../Client}/Writer/PlainWritableStrategy.php | 6 +- .../WritableMessagePartContentProcessor.php | 6 +- .../Http/Response/JsonApiStrategy.php | 218 - .../Imap/Search/SearchQueryStrategy.php | 105 - src/MailClient/Data/Resource/MailAccount.php | 109 - src/MailClient/Data/Resource/MailFolder.php | 94 - src/MailClient/Data/Resource/MessageBody.php | 93 - .../Data/Resource/MessageBodyOptions.php | 67 - .../Resource/Query/MailFolderListQuery.php | 56 - .../Data/Resource/Query/MessageBodyQuery.php | 66 - .../Resource/Query/MessageItemListQuery.php | 94 - .../Data/Resource/Query/MessageItemQuery.php | 57 - .../Exception/MailFolderNotFoundException.php | 40 - .../Exception/MessageNotFoundException.php | 40 - .../Exception/ResourceNotFoundException.php | 40 - src/Math/Expression/Expression.php | 139 - src/Math/Expression/ExpressionList.php | 61 - src/Math/Expression/FunctionalExpression.php | 119 - src/Math/Expression/LogicalExpression.php | 97 - .../Expression/Notation/PolishNotation.php | 97 - .../Operator/FunctionalOperator.php | 45 - .../Expression/Operator/LogicalOperator.php | 45 - src/Math/Expression/Operator/Operator.php | 39 - .../Operator/OperatorStringableTrait.php | 51 - .../Operator/RelationalOperator.php | 50 - src/Math/Expression/OperatorCallTrait.php | 88 - src/Math/Expression/RelationalExpression.php | 84 - src/Math/InvalidOperandException.php | 39 - src/Math/InvalidOperationException.php | 40 - src/Math/Operand.php | 47 - src/Math/OperandList.php | 61 - src/Math/Value.php | 124 - src/Math/Variable.php | 131 - src/Math/VariableName.php | 115 - src/Net/Exception/MalformedUrlException.php | 40 - src/Net/Exception/UriSyntaxException.php | 39 - src/Net/Uri.php | 138 - src/Net/Uri/Component/Path/Template.php | 179 - src/Net/Uri/Component/Path/TemplateRegex.php | 133 - src/Net/Uri/Component/Query.php | 217 - src/Net/Uri/Component/Query/Parameter.php | 109 - src/Net/Uri/Component/Query/ParameterList.php | 65 - .../Uri/Component/Query/ParameterTrait.php | 125 - src/Net/Url.php | 54 - src/Util/AbstractList.php | 179 + src/{Core => }/Util/ArrayUtil.php | 6 +- src/{Core/Contract => Util}/Arrayable.php | 5 +- src/{Core/Contract => Util}/Copyable.php | 5 +- src/{Core/Contract => Util}/JsonDecodable.php | 7 +- .../JsonDecodeException.php | 6 +- src/{Core/Contract => Util}/JsonStrategy.php | 8 +- src/{Core/Contract => Util}/Jsonable.php | 7 +- src/{Data => Util}/Modifiable.php | 5 +- src/{Data => Util}/ModifiableTrait.php | 4 +- src/{Core/Contract => Util}/Stringable.php | 11 +- .../InvalidQueryParameterValueException.php | 37 - .../Validation/Exception/QueryException.php | 39 - .../Exception/UnexpectedQueryException.php | 38 - .../UnexpectedQueryParameterException.php | 37 - .../Validation/Parameter/ParameterRule.php | 84 - .../Parameter/ParameterRuleList.php | 48 - .../Parameter/Rule/IntegerValueRule.php | 176 - .../Parameter/Rule/JsonEncodedRule.php | 60 - .../Parameter/Rule/NamedParameterRule.php | 72 - .../Parameter/Rule/ValueInWhitelistRule.php | 112 - .../Parameter/Rule/ValuesInWhitelistRule.php | 50 - src/Web/Validation/Query/QueryRule.php | 80 - src/Web/Validation/Query/QueryRuleList.php | 48 - .../Query/Rule/ExclusiveGroupKeyRule.php | 117 - .../Query/Rule/OnlyParameterNamesRule.php | 91 - .../Query/Rule/RequiredParameterNamesRule.php | 90 - src/Web/Validation/QueryValidator.php | 129 - tests/Core/AbstractListTest.php | 275 - .../Exception/ClassNotFoundExceptionTest.php | 47 - .../Exception/InvalidTypeExceptionTest.php | 47 - .../Exception/UnexpectedTypeExceptionTest.php | 49 - tests/{Data => Core}/ParameterBagTest.php | 6 +- .../Resource => Core}/ResourceQueryTest.php | 55 +- tests/Core/Util/ClassLoaderTest.php | 120 - tests/Data/Filter/FilterTest.php | 71 - .../Resource/ObjectDescriptionListTest.php | 52 - tests/Data/Resource/ObjectDescriptionTest.php | 273 - .../TestResourceObjectDescription.php | 91 - tests/Data/Resource/TestResourceStd.php | 37 - tests/Data/Sort/SortDirectionTest.php | 57 - tests/Data/Sort/SortInfoListTest.php | 110 - tests/Data/Sort/SortInfoTest.php | 76 - tests/Data/Validation/ValidationErrorTest.php | 72 - .../Data/Validation/ValidationErrorsTest.php | 74 - tests/Error/AbstractErrorTest.php | 77 - tests/Error/AnonymousErrorSourceTest.php | 86 - tests/Error/ErrorObjectListTest.php | 89 - tests/Error/ErrorObjectTest.php | 49 - tests/Error/ErrorSourceTest.php | 52 - .../Imap}/AttachmentComposerForTesting.php | 4 +- .../Imap}/AttachmentTraitForTesting.php | 6 +- .../Mail/Client/Imap}/AttachmentTraitTest.php | 20 +- .../Mail/Client/Imap/AttributeTraitTest.php | 182 + .../Client/Imap}/ClientGeneratorTrait.php | 46 +- .../Mail/Client/Imap}/FilterTraitTest.php | 66 +- .../Mail/Client/Imap}/HordeClientTest.php | 710 +- .../Mail/Client/Imap}/SocketForTesting.php | 4 +- .../Composer/HordeAttachmentComposerTest.php | 12 +- .../Composer/HordeBodyComposerTest.php | 15 +- .../Composer/HordeHeaderComposerTest.php | 18 +- .../Exception/BadRequestExceptionTest.php | 4 +- .../Http/Exception/ForbiddenExceptionTest.php | 54 - tests/Http/Exception/HttpExceptionTest.php | 2 +- .../InternalServerErrorExceptionTest.php | 6 +- .../MethodNotAllowedExceptionTest.php | 54 - .../Http/Exception/NotFoundExceptionTest.php | 52 - .../Exception/UnauthorizedExceptionTest.php | 52 - .../Http/Json/Problem/AbstractProblemTest.php | 89 + .../Json/Problem}/BadRequestProblemTest.php | 8 +- .../InternalServerErrorProblemTest.php | 11 +- .../Problem}/MethodNotAllowedProblemTest.php | 11 +- .../Json/Problem}/ProblemFactoryTest.php | 55 +- .../Json/Problem}/ProblemTest.php | 9 +- ...InvalidParameterResourceExceptionTest.php} | 17 +- .../Query}/InvalidQueryExceptionTest.php | 15 +- .../InvalidQueryParameterExceptionTest.php | 15 +- tests/Http/Query/QueryTranslatorTest.php | 142 + tests/Http/RequestMethodTest.php | 83 - tests/Http/RequestTest.php | 71 - tests/Http/{ => Status}/StatusCodesTest.php | 12 +- .../Auth/Imap/DefaultImapUserProviderTest.php | 2 +- tests/Illuminate/Auth/Imap/ImapUserTest.php | 2 +- tests/Illuminate/Auth/Imap/UtilTest.php | 2 +- ...ravelAttachmentListJsonTransformerTest.php | 12 +- .../Validation/Parameter/RelfieldRuleTest.php | 304 - tests/JsonApi/Query/QueryTest.php | 82 - .../Validation/CollectionValidatorTest.php | 194 - .../Validation/Parameter/FieldsetRuleTest.php | 284 - .../Validation/Parameter/IncludeRuleTest.php | 167 - .../Validation/Parameter/PnFilterRuleTest.php | 204 - .../Query/Validation/Query/QueryRuleTest.php | 66 - .../Query/Validation/TestQueryValidator.php | 39 - .../Query/Validation/TestValidatorStd.php | 37 - .../Query/Validation/ValidatorTest.php | 251 - tests/JsonApi/RequestTest.php | 104 - tests/JsonApi/Resource/ResourceListTest.php | 99 - .../JsonApi/Resource/ResourceResolverTest.php | 162 - tests/JsonProblem/AbstractProblemTest.php | 184 - tests/JsonProblem/ForbiddenProblemTest.php | 54 - tests/JsonProblem/NotFoundProblemTest.php | 54 - tests/JsonProblem/ProblemListTest.php | 97 - tests/JsonProblem/UnauthorizedProblemTest.php | 54 - tests/JsonableTestTrait.php | 58 - .../Attachment/AbstractAttachmentTest.php | 12 +- .../Attachment/FileAttachmentItemListTest.php | 14 +- .../Attachment/FileAttachmentItemTest.php | 14 +- .../Attachment/FileAttachmentListTest.php | 14 +- .../Client}/Attachment/FileAttachmentTest.php | 12 +- .../Processor/InlineDataProcessorTest.php | 12 +- .../Processor/ProcessorExceptionTest.php | 8 +- .../Data/CompoundKey/AttachmentKeyTest.php | 10 +- .../Data/CompoundKey/FolderKeyTest.php | 16 +- .../MessageItemChildCompoundKeyTest.php | 14 +- .../Data/CompoundKey/MessageKeyTest.php | 18 +- .../Client}/Data/DataExceptionTest.php | 8 +- .../Client}/Data/MailAccountTest.php | 20 +- .../Client}/Data/MailAddressListTest.php | 81 +- .../Client}/Data/MailAddressTest.php | 44 +- .../Client}/Folder/AbstractMailFolderTest.php | 58 +- .../Client}/Folder/ListMailFolderTest.php | 19 +- .../Folder/MailFolderChildListTest.php | 69 +- .../Client}/Folder/MailFolderListTest.php | 10 +- tests/Mail/Client/Folder/MailFolderTest.php | 181 + .../Tree/DefaultMailFolderTreeBuilderTest.php | 128 +- .../Client}/Imap/ImapClientExceptionTest.php | 8 +- .../Util/DefaultFolderIdToTypeMapperTest.php | 23 +- .../Client}/MailClientExceptionTest.php | 6 +- .../Message/AbstractMessageItemTest.php | 78 +- .../Client}/Message/DraftTraitTest.php | 22 +- .../Client}/Message/Flag/AbstractFlagTest.php | 6 +- .../Client}/Message/Flag/AnsweredFlagTest.php | 8 +- .../Client}/Message/Flag/DraftFlagTest.php | 8 +- .../Client}/Message/Flag/FlagListTest.php | 16 +- .../Client}/Message/Flag/FlaggedFlagTest.php | 8 +- .../Client}/Message/Flag/SeenFlagTest.php | 8 +- .../Client/Message/ListMessageItemTest.php | 165 + .../Client}/Message/MessageBodyDraftTest.php | 51 +- .../Client}/Message/MessageBodyTest.php | 61 +- .../Client}/Message/MessageItemDraftTest.php | 67 +- .../Client}/Message/MessageItemListTest.php | 56 +- .../Client}/Message/MessageItemTest.php | 22 +- .../Client}/Message/MessagePartTest.php | 15 +- ...bstractMessagePartContentProcessorTest.php | 25 +- .../DefaultMessageItemFieldsProcessorTest.php | 14 +- .../Text/DefaultPreviewTextProcessorTest.php | 32 +- .../Message/Text/ProcessorExceptionTest.php | 8 +- .../MessageItemListResourceQueryTest.php} | 21 +- .../DefaultPlainReadableStrategyTest.php | 8 +- .../Reader/PurifiedHtmlStrategyTest.php | 8 +- ...eadableMessagePartContentProcessorTest.php | 12 +- ...ultMessageBodyDraftJsonTransformerTest.php | 18 +- ...ultMessageItemDraftJsonTransformerTest.php | 21 +- .../Service/DefaultAttachmentServiceTest.php | 22 +- .../Service/DefaultAuthServiceTest.php | 8 +- .../Service/DefaultMailFolderServiceTest.php | 31 +- .../Service/DefaultMessageItemServiceTest.php | 406 +- .../Client}/Service/ServiceExceptionTest.php | 4 +- .../Client/Util/JsonApiStrategyTest.php} | 73 +- .../DefaultHtmlWritableStrategyTest.php | 10 +- .../DefaultPlainWritableStrategyTest.php | 10 +- ...ritableMessagePartContentProcessorTest.php | 14 +- .../Data/CompoundKey/CompoundKeyTest.php | 61 - .../Http/Response/JsonApiStrategyTest.php | 349 - .../Imap/Search/SearchQueryStrategyTest.php | 120 - .../Data/Resource/MailAccountTest.php | 135 - .../Data/Resource/MailFolderTest.php | 120 - .../Data/Resource/MessageBodyTest.php | 116 - .../Data/Resource/MessageItemTest.php | 144 - .../Query/MailFolderListQueryTest.php | 52 - .../Resource/Query/MessageBodyQueryTest.php | 54 - .../Query/MessageItemListQueryTest.php | 53 - .../MailFolderNotFoundExceptionTest.php | 49 - .../MessageNotFoundExceptionTest.php | 49 - .../ResourceNotFoundExceptionTest.php | 49 - tests/MailClient/Folder/MailFolderTest.php | 318 - tests/Math/Expression/ExpressionListTest.php | 93 - tests/Math/Expression/ExpressionTest.php | 134 - .../Expression/FunctionalExpressionTest.php | 113 - .../Math/Expression/LogicalExpressionTest.php | 165 - .../Notation/PolishNotationTest.php | 124 - .../Operator/FunctionalOperatorTest.php | 68 - .../Operator/LogicalOperatorTest.php | 72 - .../Operator/OperatorStringableTraitTest.php | 66 - .../Math/Expression/Operator/OperatorTest.php | 54 - .../Operator/RelationalOperatorTest.php | 83 - .../Math/Expression/OperatorCallTraitTest.php | 98 - .../Expression/RelationalExpressionTest.php | 140 - tests/Math/InvalidOperandExceptionTest.php | 51 - tests/Math/OperandListTest.php | 93 - tests/Math/OperandTest.php | 57 - tests/Math/ValueTest.php | 102 - tests/Math/VariableNameTest.php | 98 - tests/Math/VariableTest.php | 114 - tests/Mime/MimeTypeTest.php | 62 - .../Exception/MalformedUrlExceptionTest.php | 50 - .../Net/Exception/UriSyntaxExceptionTest.php | 51 - .../Uri/Component/Path/TemplateRegexTest.php | 140 - tests/Net/Uri/Component/Path/TemplateTest.php | 166 - .../Uri/Component/Query/ParameterListTest.php | 84 - .../Net/Uri/Component/Query/ParameterTest.php | 68 - .../Component/Query/ParameterTraitTest.php | 115 - tests/Net/Uri/Component/QueryTest.php | 214 - tests/Net/UriTest.php | 154 - tests/Net/UrlTest.php | 97 - tests/StringableTestTrait.php | 76 - tests/TestCase.php | 57 +- tests/TestTrait.php | 2 +- tests/Util/AbstractListTest.php | 115 + tests/{Core => }/Util/ArrayUtilTest.php | 4 +- .../Contract => Util}/JsonDecodableTest.php | 8 +- .../JsonDecodeExceptionTest.php | 4 +- .../{Core/Contract => Util}/JsonableTest.php | 6 +- tests/{Data => Util}/ModifiableTraitTest.php | 4 +- ...nvalidQueryParameterValueExceptionTest.php | 52 - .../Exception/QueryExceptionTest.php | 51 - .../UnexpectedQueryExceptionTest.php | 50 - .../UnexpectedQueryParameterExceptionTest.php | 51 - .../Parameter/ParameterRuleListTest.php | 64 - .../Parameter/ParameterRuleTest.php | 120 - .../Parameter/Rule/IntegerValueRuleTest.php | 128 - .../Parameter/Rule/JsonEncodedRuleTest.php | 76 - .../Parameter/Rule/NamedParameterRuleTest.php | 98 - .../Rule/ValueInWhitelistRuleTest.php | 154 - .../Rule/ValuesInWhitelistRuleTest.php | 72 - .../Validation/Query/QueryRuleListTest.php | 64 - tests/Web/Validation/Query/QueryRuleTest.php | 106 - .../Query/Rule/ExclusiveGroupKeyRuleTest.php | 109 - .../Query/Rule/OnlyParameterNamesRuleTest.php | 112 - .../Rule/RequiredParameterNamesRuleTest.php | 112 - tests/Web/Validation/QueryValidatorTest.php | 195 - 436 files changed, 5109 insertions(+), 33100 deletions(-) delete mode 100644 _composer.lock delete mode 100644 phpstan.neon delete mode 100644 src/Core/AbstractList.php delete mode 100644 src/Core/Contract/Comparable.php delete mode 100644 src/Core/Contract/Equatable.php delete mode 100644 src/Core/Contract/StringStrategy.php delete mode 100644 src/Core/Contract/StringVisitor.php delete mode 100644 src/Core/Exception/ClassNotFoundException.php delete mode 100644 src/Core/Exception/InvalidTypeException.php delete mode 100644 src/Core/Exception/UnexpectedTypeException.php rename src/{Data => Core}/ParameterBag.php (94%) rename src/{Data/Resource => Core}/ResourceQuery.php (57%) delete mode 100644 src/Core/Util/ClassLoader.php delete mode 100644 src/Data/Filter/Filter.php delete mode 100644 src/Data/Resource/ObjectDescription.php delete mode 100644 src/Data/Resource/ObjectDescriptionList.php delete mode 100644 src/Data/Sort/SortInfo.php delete mode 100644 src/Data/Sort/SortInfoList.php delete mode 100644 src/Data/Validation/Rule.php delete mode 100644 src/Data/Validation/ValidationError.php delete mode 100644 src/Data/Validation/ValidationErrors.php delete mode 100644 src/Data/Validation/Validator.php delete mode 100644 src/Error/AbstractError.php delete mode 100644 src/Error/AnonymousErrorSource.php delete mode 100644 src/Error/ErrorObject.php delete mode 100644 src/Error/ErrorObjectList.php delete mode 100644 src/Error/ErrorSource.php rename src/{Horde_Imap/Client => Horde/Mail/Client/Imap}/AttachmentTrait.php (94%) rename src/{MailClient/Data/Resource/MessageItem.php => Horde/Mail/Client/Imap/AttributeTrait.php} (53%) create mode 100644 src/Horde/Mail/Client/Imap/FilterTrait.php rename src/{Horde_Imap/Client => Horde/Mail/Client/Imap}/HordeClient.php (75%) rename src/{Horde_Mime => Horde/Mail/Client/Message}/Composer/HordeAttachmentComposer.php (91%) rename src/{Horde_Mime => Horde/Mail/Client/Message}/Composer/HordeBodyComposer.php (92%) rename src/{Horde_Mime => Horde/Mail/Client/Message}/Composer/HordeHeaderComposer.php (93%) delete mode 100644 src/Horde_Imap/Client/FilterTrait.php delete mode 100644 src/Horde_Imap/Client/SortInfoStrategy.php delete mode 100644 src/Http/Exception/ForbiddenException.php delete mode 100644 src/Http/Exception/MethodNotAllowedException.php delete mode 100644 src/Http/Exception/NotFoundException.php delete mode 100644 src/Http/Exception/UnauthorizedException.php rename src/{JsonProblem => Http/Json/Problem}/AbstractProblem.php (66%) rename src/{JsonProblem => Http/Json/Problem}/BadRequestProblem.php (94%) rename src/{JsonProblem => Http/Json/Problem}/InternalServerErrorProblem.php (94%) rename src/{JsonProblem => Http/Json/Problem}/MethodNotAllowedProblem.php (94%) rename src/{JsonProblem => Http/Json/Problem}/Problem.php (98%) rename src/{JsonProblem => Http/Json/Problem}/ProblemFactory.php (79%) rename src/{JsonProblem => Http/Json/Problem}/README.md (77%) rename src/{Mime/MimeType.php => Http/Query/InvalidParameterResourceException.php} (79%) rename src/{Web/Validation/Exception => Http/Query}/InvalidQueryException.php (79%) rename src/{Web/Validation/Exception => Http/Query}/InvalidQueryParameterException.php (79%) create mode 100644 src/Http/Query/QueryTranslator.php delete mode 100644 src/Http/Request.php delete mode 100644 src/Http/RequestMethod.php rename src/Http/{ => Status}/StatusCodes.php (80%) rename src/Illuminate/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Attachment}/Transformer/LaravelAttachmentListJsonTransformer.php (88%) delete mode 100644 src/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRule.php delete mode 100644 src/JsonApi/Query/Query.php delete mode 100644 src/JsonApi/Query/Validation/CollectionValidator.php delete mode 100644 src/JsonApi/Query/Validation/Parameter/FieldsetRule.php delete mode 100644 src/JsonApi/Query/Validation/Parameter/IncludeRule.php delete mode 100644 src/JsonApi/Query/Validation/Parameter/PnFilterRule.php delete mode 100644 src/JsonApi/Query/Validation/Query/QueryRule.php delete mode 100644 src/JsonApi/Query/Validation/Validator.php delete mode 100644 src/JsonApi/Request.php delete mode 100644 src/JsonApi/Resource/Resource.php delete mode 100644 src/JsonApi/Resource/ResourceCollection.php delete mode 100644 src/JsonApi/Resource/ResourceList.php delete mode 100644 src/JsonApi/Resource/ResourceResolver.php delete mode 100644 src/JsonProblem/ForbiddenProblem.php delete mode 100644 src/JsonProblem/NotFoundProblem.php delete mode 100644 src/JsonProblem/ProblemList.php delete mode 100644 src/JsonProblem/UnauthorizedProblem.php rename src/{MailClient/Message => Mail/Client}/Attachment/AbstractAttachment.php (93%) rename src/{MailClient/Message => Mail/Client}/Attachment/FileAttachment.php (94%) rename src/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentItem.php (93%) rename src/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentItemList.php (90%) rename src/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentList.php (89%) rename src/{MailClient/Message => Mail/Client}/Attachment/Processor/FileAttachmentProcessor.php (89%) rename src/{MailClient/Message => Mail/Client}/Attachment/Processor/InlineDataProcessor.php (90%) rename src/{MailClient/Message => Mail/Client}/Attachment/Processor/ProcessorException.php (88%) rename src/{MailClient => Mail/Client}/Data/CompoundKey/AttachmentKey.php (93%) rename src/{MailClient => Mail/Client}/Data/CompoundKey/CompoundKey.php (82%) rename src/{MailClient => Mail/Client}/Data/CompoundKey/FolderKey.php (93%) rename src/{MailClient => Mail/Client}/Data/CompoundKey/MessageItemChildCompoundKey.php (94%) rename src/{MailClient => Mail/Client}/Data/CompoundKey/MessageKey.php (93%) rename src/{MailClient => Mail/Client}/Data/DataException.php (91%) rename src/{MailClient => Mail/Client}/Data/MailAccount.php (97%) rename src/{MailClient => Mail/Client}/Data/MailAddress.php (83%) rename src/{MailClient => Mail/Client}/Data/MailAddressList.php (81%) rename src/{MailClient => Mail/Client}/Folder/AbstractMailFolder.php (68%) rename src/{MailClient => Mail/Client}/Folder/FolderIdToTypeMapper.php (95%) rename src/{MailClient => Mail/Client}/Folder/ListMailFolder.php (93%) rename src/{MailClient => Mail/Client}/Folder/MailFolder.php (64%) rename src/{MailClient => Mail/Client}/Folder/MailFolderChildList.php (75%) rename src/{MailClient => Mail/Client}/Folder/MailFolderList.php (85%) rename src/{MailClient => Mail/Client}/Folder/Tree/DefaultMailFolderTreeBuilder.php (55%) rename src/{MailClient => Mail/Client}/Folder/Tree/MailFolderTreeBuilder.php (81%) rename src/{MailClient/Data/Protocol => Mail/Client}/Imap/ImapClientException.php (93%) rename src/{MailClient/Data/Protocol => Mail/Client}/Imap/Util/DefaultFolderIdToTypeMapper.php (88%) rename src/{MailClient => Mail/Client}/MailClient.php (71%) rename src/{MailClient/Exception => Mail/Client}/MailClientException.php (94%) rename src/{MailClient => Mail/Client}/Message/AbstractMessageBody.php (84%) rename src/{MailClient => Mail/Client}/Message/AbstractMessageItem.php (84%) rename src/{MailClient => Mail/Client}/Message/Composer/AttachmentComposer.php (91%) rename src/{MailClient => Mail/Client}/Message/Composer/BodyComposer.php (93%) rename src/{MailClient => Mail/Client}/Message/Composer/HeaderComposer.php (93%) rename src/{MailClient => Mail/Client}/Message/Composer/README.md (76%) rename src/{MailClient => Mail/Client}/Message/DraftTrait.php (96%) rename src/{MailClient => Mail/Client}/Message/Flag/AbstractFlag.php (95%) rename src/{MailClient => Mail/Client}/Message/Flag/AnsweredFlag.php (94%) rename src/{MailClient => Mail/Client}/Message/Flag/DraftFlag.php (94%) rename src/{MailClient => Mail/Client}/Message/Flag/FlagList.php (94%) rename src/{MailClient => Mail/Client}/Message/Flag/FlaggedFlag.php (94%) rename src/{MailClient => Mail/Client}/Message/Flag/SeenFlag.php (94%) create mode 100644 src/Mail/Client/Message/ListMessageItem.php rename src/{MailClient => Mail/Client}/Message/MessageBody.php (93%) rename src/{MailClient => Mail/Client}/Message/MessageBodyDraft.php (94%) rename src/{MailClient => Mail/Client}/Message/MessageItem.php (75%) rename src/{MailClient => Mail/Client}/Message/MessageItemDraft.php (72%) rename src/{MailClient => Mail/Client}/Message/MessageItemList.php (68%) rename src/{MailClient => Mail/Client}/Message/MessagePart.php (87%) rename src/{MailClient => Mail/Client}/Message/README.md (82%) rename src/{MailClient => Mail/Client}/Message/Text/AbstractMessagePartContentProcessor.php (93%) rename src/{MailClient => Mail/Client}/Message/Text/DefaultMessageItemFieldsProcessor.php (94%) rename src/{MailClient => Mail/Client}/Message/Text/DefaultPreviewTextProcessor.php (93%) rename src/{MailClient => Mail/Client}/Message/Text/HtmlTextStrategy.php (94%) rename src/{MailClient => Mail/Client}/Message/Text/MessageItemFieldsProcessor.php (92%) rename src/{MailClient => Mail/Client}/Message/Text/MessagePartContentProcessor.php (93%) rename src/{MailClient => Mail/Client}/Message/Text/PlainTextStrategy.php (94%) rename src/{MailClient => Mail/Client}/Message/Text/PreviewTextProcessor.php (93%) rename src/{MailClient => Mail/Client}/Message/Text/ProcessorException.php (90%) rename src/{Data/Sort/SortDirection.php => Mail/Client/Query/MessageItemListResourceQuery.php} (81%) rename src/{MailClient/Data => Mail/Client}/Reader/DefaultPlainReadableStrategy.php (94%) rename src/{MailClient/Data => Mail/Client}/Reader/HtmlReadableStrategy.php (91%) rename src/{MailClient/Data => Mail/Client}/Reader/PlainReadableStrategy.php (90%) rename src/{MailClient/Data => Mail/Client}/Reader/PurifiedHtmlStrategy.php (95%) rename src/{MailClient/Data => Mail/Client}/Reader/ReadableMessagePartContentProcessor.php (91%) rename src/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Attachment}/Transformer/AttachmentListJsonTransformer.php (87%) rename src/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Message}/Transformer/DefaultMessageBodyDraftJsonTransformer.php (86%) rename src/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Message}/Transformer/DefaultMessageItemDraftJsonTransformer.php (91%) rename src/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Message}/Transformer/MessageBodyDraftJsonTransformer.php (87%) rename src/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Message}/Transformer/MessageItemDraftJsonTransformer.php (87%) rename src/{MailClient => Mail/Client}/Service/AttachmentService.php (87%) rename src/{MailClient => Mail/Client}/Service/AuthService.php (95%) rename src/{MailClient => Mail/Client}/Service/DefaultAttachmentService.php (90%) rename src/{MailClient => Mail/Client}/Service/DefaultAuthService.php (96%) rename src/{MailClient => Mail/Client}/Service/DefaultMailFolderService.php (85%) rename src/{MailClient => Mail/Client}/Service/DefaultMessageItemService.php (77%) rename src/{MailClient => Mail/Client}/Service/MailFolderService.php (85%) rename src/{MailClient => Mail/Client}/Service/MessageItemService.php (72%) rename src/{MailClient => Mail/Client}/Service/ServiceException.php (94%) create mode 100644 src/Mail/Client/Util/JsonApiStrategy.php rename src/{MailClient/Data => Mail/Client}/Writer/DefaultHtmlWritableStrategy.php (94%) rename src/{MailClient/Data => Mail/Client}/Writer/DefaultPlainWritableStrategy.php (95%) rename src/{MailClient/Data => Mail/Client}/Writer/HtmlWritableStrategy.php (91%) rename src/{MailClient/Data => Mail/Client}/Writer/PlainWritableStrategy.php (90%) rename src/{MailClient/Data => Mail/Client}/Writer/WritableMessagePartContentProcessor.php (91%) delete mode 100644 src/MailClient/Data/Protocol/Http/Response/JsonApiStrategy.php delete mode 100644 src/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategy.php delete mode 100644 src/MailClient/Data/Resource/MailAccount.php delete mode 100644 src/MailClient/Data/Resource/MailFolder.php delete mode 100644 src/MailClient/Data/Resource/MessageBody.php delete mode 100644 src/MailClient/Data/Resource/MessageBodyOptions.php delete mode 100644 src/MailClient/Data/Resource/Query/MailFolderListQuery.php delete mode 100644 src/MailClient/Data/Resource/Query/MessageBodyQuery.php delete mode 100644 src/MailClient/Data/Resource/Query/MessageItemListQuery.php delete mode 100644 src/MailClient/Data/Resource/Query/MessageItemQuery.php delete mode 100644 src/MailClient/Exception/MailFolderNotFoundException.php delete mode 100644 src/MailClient/Exception/MessageNotFoundException.php delete mode 100644 src/MailClient/Exception/ResourceNotFoundException.php delete mode 100644 src/Math/Expression/Expression.php delete mode 100644 src/Math/Expression/ExpressionList.php delete mode 100644 src/Math/Expression/FunctionalExpression.php delete mode 100644 src/Math/Expression/LogicalExpression.php delete mode 100644 src/Math/Expression/Notation/PolishNotation.php delete mode 100644 src/Math/Expression/Operator/FunctionalOperator.php delete mode 100644 src/Math/Expression/Operator/LogicalOperator.php delete mode 100644 src/Math/Expression/Operator/Operator.php delete mode 100644 src/Math/Expression/Operator/OperatorStringableTrait.php delete mode 100644 src/Math/Expression/Operator/RelationalOperator.php delete mode 100644 src/Math/Expression/OperatorCallTrait.php delete mode 100644 src/Math/Expression/RelationalExpression.php delete mode 100644 src/Math/InvalidOperandException.php delete mode 100644 src/Math/InvalidOperationException.php delete mode 100644 src/Math/Operand.php delete mode 100644 src/Math/OperandList.php delete mode 100644 src/Math/Value.php delete mode 100644 src/Math/Variable.php delete mode 100644 src/Math/VariableName.php delete mode 100644 src/Net/Exception/MalformedUrlException.php delete mode 100644 src/Net/Exception/UriSyntaxException.php delete mode 100644 src/Net/Uri.php delete mode 100644 src/Net/Uri/Component/Path/Template.php delete mode 100644 src/Net/Uri/Component/Path/TemplateRegex.php delete mode 100644 src/Net/Uri/Component/Query.php delete mode 100644 src/Net/Uri/Component/Query/Parameter.php delete mode 100644 src/Net/Uri/Component/Query/ParameterList.php delete mode 100644 src/Net/Uri/Component/Query/ParameterTrait.php delete mode 100644 src/Net/Url.php create mode 100644 src/Util/AbstractList.php rename src/{Core => }/Util/ArrayUtil.php (98%) rename src/{Core/Contract => Util}/Arrayable.php (95%) rename src/{Core/Contract => Util}/Copyable.php (95%) rename src/{Core/Contract => Util}/JsonDecodable.php (94%) rename src/{Core/Exception => Util}/JsonDecodeException.php (93%) rename src/{Core/Contract => Util}/JsonStrategy.php (93%) rename src/{Core/Contract => Util}/Jsonable.php (94%) rename src/{Data => Util}/Modifiable.php (95%) rename src/{Data => Util}/ModifiableTrait.php (98%) rename src/{Core/Contract => Util}/Stringable.php (85%) delete mode 100644 src/Web/Validation/Exception/InvalidQueryParameterValueException.php delete mode 100644 src/Web/Validation/Exception/QueryException.php delete mode 100644 src/Web/Validation/Exception/UnexpectedQueryException.php delete mode 100644 src/Web/Validation/Exception/UnexpectedQueryParameterException.php delete mode 100644 src/Web/Validation/Parameter/ParameterRule.php delete mode 100644 src/Web/Validation/Parameter/ParameterRuleList.php delete mode 100644 src/Web/Validation/Parameter/Rule/IntegerValueRule.php delete mode 100644 src/Web/Validation/Parameter/Rule/JsonEncodedRule.php delete mode 100644 src/Web/Validation/Parameter/Rule/NamedParameterRule.php delete mode 100644 src/Web/Validation/Parameter/Rule/ValueInWhitelistRule.php delete mode 100644 src/Web/Validation/Parameter/Rule/ValuesInWhitelistRule.php delete mode 100644 src/Web/Validation/Query/QueryRule.php delete mode 100644 src/Web/Validation/Query/QueryRuleList.php delete mode 100644 src/Web/Validation/Query/Rule/ExclusiveGroupKeyRule.php delete mode 100644 src/Web/Validation/Query/Rule/OnlyParameterNamesRule.php delete mode 100644 src/Web/Validation/Query/Rule/RequiredParameterNamesRule.php delete mode 100644 src/Web/Validation/QueryValidator.php delete mode 100644 tests/Core/AbstractListTest.php delete mode 100644 tests/Core/Exception/ClassNotFoundExceptionTest.php delete mode 100644 tests/Core/Exception/InvalidTypeExceptionTest.php delete mode 100644 tests/Core/Exception/UnexpectedTypeExceptionTest.php rename tests/{Data => Core}/ParameterBagTest.php (97%) rename tests/{Data/Resource => Core}/ResourceQueryTest.php (70%) delete mode 100644 tests/Core/Util/ClassLoaderTest.php delete mode 100644 tests/Data/Filter/FilterTest.php delete mode 100644 tests/Data/Resource/ObjectDescriptionListTest.php delete mode 100644 tests/Data/Resource/ObjectDescriptionTest.php delete mode 100644 tests/Data/Resource/TestResourceObjectDescription.php delete mode 100644 tests/Data/Resource/TestResourceStd.php delete mode 100644 tests/Data/Sort/SortDirectionTest.php delete mode 100644 tests/Data/Sort/SortInfoListTest.php delete mode 100644 tests/Data/Sort/SortInfoTest.php delete mode 100644 tests/Data/Validation/ValidationErrorTest.php delete mode 100644 tests/Data/Validation/ValidationErrorsTest.php delete mode 100644 tests/Error/AbstractErrorTest.php delete mode 100644 tests/Error/AnonymousErrorSourceTest.php delete mode 100644 tests/Error/ErrorObjectListTest.php delete mode 100644 tests/Error/ErrorObjectTest.php delete mode 100644 tests/Error/ErrorSourceTest.php rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/AttachmentComposerForTesting.php (93%) rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/AttachmentTraitForTesting.php (94%) rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/AttachmentTraitTest.php (96%) create mode 100644 tests/Horde/Mail/Client/Imap/AttributeTraitTest.php rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/ClientGeneratorTrait.php (75%) rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/FilterTraitTest.php (54%) rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/HordeClientTest.php (68%) rename tests/{Horde_Imap/Client => Horde/Mail/Client/Imap}/SocketForTesting.php (93%) rename tests/{Horde_Mime => Horde/Mail/Client/Message}/Composer/HordeAttachmentComposerTest.php (91%) rename tests/{Horde_Mime => Horde/Mail/Client/Message}/Composer/HordeBodyComposerTest.php (89%) rename tests/{Horde_Mime => Horde/Mail/Client/Message}/Composer/HordeHeaderComposerTest.php (96%) delete mode 100644 tests/Http/Exception/ForbiddenExceptionTest.php delete mode 100644 tests/Http/Exception/MethodNotAllowedExceptionTest.php delete mode 100644 tests/Http/Exception/NotFoundExceptionTest.php delete mode 100644 tests/Http/Exception/UnauthorizedExceptionTest.php create mode 100644 tests/Http/Json/Problem/AbstractProblemTest.php rename tests/{JsonProblem => Http/Json/Problem}/BadRequestProblemTest.php (90%) rename tests/{JsonProblem => Http/Json/Problem}/InternalServerErrorProblemTest.php (85%) rename tests/{JsonProblem => Http/Json/Problem}/MethodNotAllowedProblemTest.php (85%) rename tests/{JsonProblem => Http/Json/Problem}/ProblemFactoryTest.php (67%) rename tests/{JsonProblem => Http/Json/Problem}/ProblemTest.php (90%) rename tests/{Math/InvalidOperationExceptionTest.php => Http/Query/InvalidParameterResourceExceptionTest.php} (70%) rename tests/{Web/Validation/Exception => Http/Query}/InvalidQueryExceptionTest.php (76%) rename tests/{Web/Validation/Exception => Http/Query}/InvalidQueryParameterExceptionTest.php (76%) create mode 100644 tests/Http/Query/QueryTranslatorTest.php delete mode 100644 tests/Http/RequestMethodTest.php delete mode 100644 tests/Http/RequestTest.php rename tests/Http/{ => Status}/StatusCodesTest.php (79%) delete mode 100644 tests/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRuleTest.php delete mode 100644 tests/JsonApi/Query/QueryTest.php delete mode 100644 tests/JsonApi/Query/Validation/CollectionValidatorTest.php delete mode 100644 tests/JsonApi/Query/Validation/Parameter/FieldsetRuleTest.php delete mode 100644 tests/JsonApi/Query/Validation/Parameter/IncludeRuleTest.php delete mode 100644 tests/JsonApi/Query/Validation/Parameter/PnFilterRuleTest.php delete mode 100644 tests/JsonApi/Query/Validation/Query/QueryRuleTest.php delete mode 100644 tests/JsonApi/Query/Validation/TestQueryValidator.php delete mode 100644 tests/JsonApi/Query/Validation/TestValidatorStd.php delete mode 100644 tests/JsonApi/Query/Validation/ValidatorTest.php delete mode 100644 tests/JsonApi/RequestTest.php delete mode 100644 tests/JsonApi/Resource/ResourceListTest.php delete mode 100644 tests/JsonApi/Resource/ResourceResolverTest.php delete mode 100644 tests/JsonProblem/AbstractProblemTest.php delete mode 100644 tests/JsonProblem/ForbiddenProblemTest.php delete mode 100644 tests/JsonProblem/NotFoundProblemTest.php delete mode 100644 tests/JsonProblem/ProblemListTest.php delete mode 100644 tests/JsonProblem/UnauthorizedProblemTest.php delete mode 100644 tests/JsonableTestTrait.php rename tests/{MailClient/Message => Mail/Client}/Attachment/AbstractAttachmentTest.php (93%) rename tests/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentItemListTest.php (88%) rename tests/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentItemTest.php (92%) rename tests/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentListTest.php (88%) rename tests/{MailClient/Message => Mail/Client}/Attachment/FileAttachmentTest.php (94%) rename tests/{MailClient/Message => Mail/Client}/Attachment/Processor/InlineDataProcessorTest.php (88%) rename tests/{MailClient/Message => Mail/Client}/Attachment/Processor/ProcessorExceptionTest.php (85%) rename tests/{MailClient => Mail/Client}/Data/CompoundKey/AttachmentKeyTest.php (88%) rename tests/{MailClient => Mail/Client}/Data/CompoundKey/FolderKeyTest.php (83%) rename tests/{MailClient => Mail/Client}/Data/CompoundKey/MessageItemChildCompoundKeyTest.php (94%) rename tests/{MailClient => Mail/Client}/Data/CompoundKey/MessageKeyTest.php (89%) rename tests/{MailClient => Mail/Client}/Data/DataExceptionTest.php (89%) rename tests/{MailClient => Mail/Client}/Data/MailAccountTest.php (93%) rename tests/{MailClient => Mail/Client}/Data/MailAddressListTest.php (72%) rename tests/{MailClient => Mail/Client}/Data/MailAddressTest.php (84%) rename tests/{MailClient => Mail/Client}/Folder/AbstractMailFolderTest.php (64%) rename tests/{MailClient => Mail/Client}/Folder/ListMailFolderTest.php (87%) rename tests/{MailClient => Mail/Client}/Folder/MailFolderChildListTest.php (58%) rename tests/{MailClient => Mail/Client}/Folder/MailFolderListTest.php (88%) create mode 100644 tests/Mail/Client/Folder/MailFolderTest.php rename tests/{MailClient => Mail/Client}/Folder/Tree/DefaultMailFolderTreeBuilderTest.php (70%) rename tests/{MailClient/Data/Protocol => Mail/Client}/Imap/ImapClientExceptionTest.php (86%) rename tests/{MailClient/Data/Protocol => Mail/Client}/Imap/Util/DefaultFolderIdToTypeMapperTest.php (94%) rename tests/{MailClient/Exception => Mail/Client}/MailClientExceptionTest.php (91%) rename tests/{MailClient => Mail/Client}/Message/AbstractMessageItemTest.php (88%) rename tests/{MailClient => Mail/Client}/Message/DraftTraitTest.php (86%) rename tests/{MailClient => Mail/Client}/Message/Flag/AbstractFlagTest.php (93%) rename tests/{MailClient => Mail/Client}/Message/Flag/AnsweredFlagTest.php (89%) rename tests/{MailClient => Mail/Client}/Message/Flag/DraftFlagTest.php (89%) rename tests/{MailClient => Mail/Client}/Message/Flag/FlagListTest.php (84%) rename tests/{MailClient => Mail/Client}/Message/Flag/FlaggedFlagTest.php (89%) rename tests/{MailClient => Mail/Client}/Message/Flag/SeenFlagTest.php (89%) create mode 100644 tests/Mail/Client/Message/ListMessageItemTest.php rename tests/{MailClient => Mail/Client}/Message/MessageBodyDraftTest.php (72%) rename tests/{MailClient => Mail/Client}/Message/MessageBodyTest.php (65%) rename tests/{MailClient => Mail/Client}/Message/MessageItemDraftTest.php (87%) rename tests/{MailClient => Mail/Client}/Message/MessageItemListTest.php (63%) rename tests/{MailClient => Mail/Client}/Message/MessageItemTest.php (89%) rename tests/{MailClient => Mail/Client}/Message/MessagePartTest.php (82%) rename tests/{MailClient => Mail/Client}/Message/Text/AbstractMessagePartContentProcessorTest.php (84%) rename tests/{MailClient => Mail/Client}/Message/Text/DefaultMessageItemFieldsProcessorTest.php (88%) rename tests/{MailClient => Mail/Client}/Message/Text/DefaultPreviewTextProcessorTest.php (86%) rename tests/{MailClient => Mail/Client}/Message/Text/ProcessorExceptionTest.php (87%) rename tests/{MailClient/Data/Resource/Query/MessageItemQueryTest.php => Mail/Client/Query/MessageItemListResourceQueryTest.php} (69%) rename tests/{MailClient/Data => Mail/Client}/Reader/DefaultPlainReadableStrategyTest.php (88%) rename tests/{MailClient/Data => Mail/Client}/Reader/PurifiedHtmlStrategyTest.php (89%) rename tests/{MailClient/Data => Mail/Client}/Reader/ReadableMessagePartContentProcessorTest.php (88%) rename tests/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Message}/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php (86%) rename tests/{MailClient/Data/Protocol/Http/Request => Mail/Client/Request/Message}/Transformer/DefaultMessageItemDraftJsonTransformerTest.php (93%) rename tests/{MailClient => Mail/Client}/Service/DefaultAttachmentServiceTest.php (92%) rename tests/{MailClient => Mail/Client}/Service/DefaultAuthServiceTest.php (94%) rename tests/{MailClient => Mail/Client}/Service/DefaultMailFolderServiceTest.php (82%) rename tests/{MailClient => Mail/Client}/Service/DefaultMessageItemServiceTest.php (80%) rename tests/{MailClient => Mail/Client}/Service/ServiceExceptionTest.php (94%) rename tests/{Horde_Imap/Client/SortInfoStrategyTest.php => Mail/Client/Util/JsonApiStrategyTest.php} (51%) rename tests/{MailClient/Data => Mail/Client}/Writer/DefaultHtmlWritableStrategyTest.php (87%) rename tests/{MailClient/Data => Mail/Client}/Writer/DefaultPlainWritableStrategyTest.php (88%) rename tests/{MailClient/Data => Mail/Client}/Writer/WritableMessagePartContentProcessorTest.php (87%) delete mode 100644 tests/MailClient/Data/CompoundKey/CompoundKeyTest.php delete mode 100644 tests/MailClient/Data/Protocol/Http/Response/JsonApiStrategyTest.php delete mode 100644 tests/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategyTest.php delete mode 100644 tests/MailClient/Data/Resource/MailAccountTest.php delete mode 100644 tests/MailClient/Data/Resource/MailFolderTest.php delete mode 100644 tests/MailClient/Data/Resource/MessageBodyTest.php delete mode 100644 tests/MailClient/Data/Resource/MessageItemTest.php delete mode 100644 tests/MailClient/Data/Resource/Query/MailFolderListQueryTest.php delete mode 100644 tests/MailClient/Data/Resource/Query/MessageBodyQueryTest.php delete mode 100644 tests/MailClient/Data/Resource/Query/MessageItemListQueryTest.php delete mode 100644 tests/MailClient/Exception/MailFolderNotFoundExceptionTest.php delete mode 100644 tests/MailClient/Exception/MessageNotFoundExceptionTest.php delete mode 100644 tests/MailClient/Exception/ResourceNotFoundExceptionTest.php delete mode 100644 tests/MailClient/Folder/MailFolderTest.php delete mode 100644 tests/Math/Expression/ExpressionListTest.php delete mode 100644 tests/Math/Expression/ExpressionTest.php delete mode 100644 tests/Math/Expression/FunctionalExpressionTest.php delete mode 100644 tests/Math/Expression/LogicalExpressionTest.php delete mode 100644 tests/Math/Expression/Notation/PolishNotationTest.php delete mode 100644 tests/Math/Expression/Operator/FunctionalOperatorTest.php delete mode 100644 tests/Math/Expression/Operator/LogicalOperatorTest.php delete mode 100644 tests/Math/Expression/Operator/OperatorStringableTraitTest.php delete mode 100644 tests/Math/Expression/Operator/OperatorTest.php delete mode 100644 tests/Math/Expression/Operator/RelationalOperatorTest.php delete mode 100644 tests/Math/Expression/OperatorCallTraitTest.php delete mode 100644 tests/Math/Expression/RelationalExpressionTest.php delete mode 100644 tests/Math/InvalidOperandExceptionTest.php delete mode 100644 tests/Math/OperandListTest.php delete mode 100644 tests/Math/OperandTest.php delete mode 100644 tests/Math/ValueTest.php delete mode 100644 tests/Math/VariableNameTest.php delete mode 100644 tests/Math/VariableTest.php delete mode 100644 tests/Mime/MimeTypeTest.php delete mode 100644 tests/Net/Exception/MalformedUrlExceptionTest.php delete mode 100644 tests/Net/Exception/UriSyntaxExceptionTest.php delete mode 100644 tests/Net/Uri/Component/Path/TemplateRegexTest.php delete mode 100644 tests/Net/Uri/Component/Path/TemplateTest.php delete mode 100644 tests/Net/Uri/Component/Query/ParameterListTest.php delete mode 100644 tests/Net/Uri/Component/Query/ParameterTest.php delete mode 100644 tests/Net/Uri/Component/Query/ParameterTraitTest.php delete mode 100644 tests/Net/Uri/Component/QueryTest.php delete mode 100644 tests/Net/UriTest.php delete mode 100644 tests/Net/UrlTest.php delete mode 100644 tests/StringableTestTrait.php create mode 100644 tests/Util/AbstractListTest.php rename tests/{Core => }/Util/ArrayUtilTest.php (98%) rename tests/{Core/Contract => Util}/JsonDecodableTest.php (93%) rename tests/{Core/Exception => Util}/JsonDecodeExceptionTest.php (94%) rename tests/{Core/Contract => Util}/JsonableTest.php (96%) rename tests/{Data => Util}/ModifiableTraitTest.php (97%) delete mode 100644 tests/Web/Validation/Exception/InvalidQueryParameterValueExceptionTest.php delete mode 100644 tests/Web/Validation/Exception/QueryExceptionTest.php delete mode 100644 tests/Web/Validation/Exception/UnexpectedQueryExceptionTest.php delete mode 100644 tests/Web/Validation/Exception/UnexpectedQueryParameterExceptionTest.php delete mode 100644 tests/Web/Validation/Parameter/ParameterRuleListTest.php delete mode 100644 tests/Web/Validation/Parameter/ParameterRuleTest.php delete mode 100644 tests/Web/Validation/Parameter/Rule/IntegerValueRuleTest.php delete mode 100644 tests/Web/Validation/Parameter/Rule/JsonEncodedRuleTest.php delete mode 100644 tests/Web/Validation/Parameter/Rule/NamedParameterRuleTest.php delete mode 100644 tests/Web/Validation/Parameter/Rule/ValueInWhitelistRuleTest.php delete mode 100644 tests/Web/Validation/Parameter/Rule/ValuesInWhitelistRuleTest.php delete mode 100644 tests/Web/Validation/Query/QueryRuleListTest.php delete mode 100644 tests/Web/Validation/Query/QueryRuleTest.php delete mode 100644 tests/Web/Validation/Query/Rule/ExclusiveGroupKeyRuleTest.php delete mode 100644 tests/Web/Validation/Query/Rule/OnlyParameterNamesRuleTest.php delete mode 100644 tests/Web/Validation/Query/Rule/RequiredParameterNamesRuleTest.php delete mode 100644 tests/Web/Validation/QueryValidatorTest.php diff --git a/_composer.lock b/_composer.lock deleted file mode 100644 index 7de1a1a8..00000000 --- a/_composer.lock +++ /dev/null @@ -1,7367 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "0677d35912dcf342bc573d5543b3d8a9", - "packages": [ - { - "name": "doctrine/inflector", - "version": "1.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", - "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector", - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "keywords": [ - "inflection", - "inflector", - "lowercase", - "manipulation", - "php", - "plural", - "singular", - "strings", - "uppercase", - "words" - ], - "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/1.4.x" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], - "time": "2021-04-16T17:34:40+00:00" - }, - { - "name": "doctrine/lexer", - "version": "1.3.x-dev", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "ff0bfc39c3cce1cc0aa69471235194c6f104384d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/ff0bfc39c3cce1cc0aa69471235194c6f104384d", - "reference": "ff0bfc39c3cce1cc0aa69471235194c6f104384d", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.3.x" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-02-28T11:12:09+00:00" - }, - { - "name": "dragonmantank/cron-expression", - "version": "v2.3.1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2", - "shasum": "" - }, - "require": { - "php": "^7.0|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Cron\\": "src/Cron/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Chris Tankersley", - "email": "chris@ctankersley.com", - "homepage": "https://github.com/dragonmantank" - } - ], - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": [ - "cron", - "schedule" - ], - "support": { - "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v2.3.1" - }, - "funding": [ - { - "url": "https://github.com/dragonmantank", - "type": "github" - } - ], - "time": "2020-10-13T00:52:37+00:00" - }, - { - "name": "egulias/email-validator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", - "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1.0.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.10" - }, - "require-dev": { - "dominicsayers/isemail": "^3.0.7", - "phpunit/phpunit": "^4.8.36|^7.5.15", - "satooshi/php-coveralls": "^1.0.1" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ], - "support": { - "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" - }, - "funding": [ - { - "url": "https://github.com/egulias", - "type": "github" - } - ], - "time": "2020-12-29T14:50:06+00:00" - }, - { - "name": "ezyang/htmlpurifier", - "version": "v4.14.0", - "source": { - "type": "git", - "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "type": "library", - "autoload": { - "files": [ - "library/HTMLPurifier.composer.php" - ], - "psr-0": { - "HTMLPurifier": "library/" - }, - "exclude-from-classmap": [ - "/library/HTMLPurifier/Language/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-or-later" - ], - "authors": [ - { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" - } - ], - "description": "Standards compliant HTML filter written in PHP", - "homepage": "http://htmlpurifier.org/", - "keywords": [ - "html" - ], - "support": { - "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0" - }, - "time": "2021-12-25T01:21:49+00:00" - }, - { - "name": "horde/crypt_blowfish", - "version": "v2.0.0alpha2", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Crypt_Blowfish.git", - "reference": "501a2af5520e4aa64dc7b4a1563aa5193a3c33df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Crypt_Blowfish/zipball/501a2af5520e4aa64dc7b4a1563aa5193a3c33df", - "reference": "501a2af5520e4aa64dc7b4a1563aa5193a3c33df", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "horde/support": "^3", - "php": "^7" - }, - "suggest": { - "ext-mcrypt": "*", - "ext-openssl": "*", - "horde/test": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Crypt_Blowfish": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "Blowfish encryption library", - "homepage": "https://www.horde.org/libraries/Horde_Crypt_Blowfish", - "support": { - "source": "https://github.com/maintaina-com/Crypt_Blowfish/tree/v2.0.0alpha2" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/exception", - "version": "v3.0.0alpha4", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Exception.git", - "reference": "301c19ea90adcebb508969ca2e80b90a17a5a6df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Exception/zipball/301c19ea90adcebb508969ca2e80b90a17a5a6df", - "reference": "301c19ea90adcebb508969ca2e80b90a17a5a6df", - "shasum": "" - }, - "require": { - "horde/translation": "^3 || dev-FRAMEWORK_6_0", - "php": "^7 || ^8" - }, - "suggest": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Exception": "lib/" - }, - "psr-4": { - "Horde\\Exception\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Horde\\Exception\\Test\\": "test/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Jan Schneider", - "email": "jan@horde.org", - "role": "lead" - }, - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "developer" - } - ], - "description": "Exception handler library", - "homepage": "https://www.horde.org/libraries/Horde_Exception", - "support": { - "source": "https://github.com/maintaina-com/Exception/tree/v3.0.0alpha4" - }, - "time": "2021-08-05T00:00:00+00:00" - }, - { - "name": "horde/horde-installer-plugin", - "version": "v2.3.0", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/horde-installer-plugin.git", - "reference": "a55619bdf2245ed4b3f00e7a692ff891629bc531" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/horde-installer-plugin/zipball/a55619bdf2245ed4b3f00e7a692ff891629bc531", - "reference": "a55619bdf2245ed4b3f00e7a692ff891629bc531", - "shasum": "" - }, - "require": { - "composer-plugin-api": "~2.0" - }, - "require-dev": { - "composer/composer": "~2.0", - "horde/test": "^3" - }, - "type": "composer-plugin", - "extra": { - "class": "Horde\\Composer\\HordeInstallerPlugin" - }, - "autoload": { - "psr-4": { - "Horde\\Composer\\": "src/" - } - }, - "license": [ - "MIT" - ], - "support": { - "source": "https://github.com/maintaina-com/horde-installer-plugin/tree/v2.3.0" - }, - "time": "2021-11-03T17:00:53+00:00" - }, - { - "name": "horde/idna", - "version": "v2.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Idna.git", - "reference": "10842cc8e8b80af35eb8eef3cfbdacc2a9ab22f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Idna/zipball/10842cc8e8b80af35eb8eef3cfbdacc2a9ab22f2", - "reference": "10842cc8e8b80af35eb8eef3cfbdacc2a9ab22f2", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "horde/util": "^3", - "php": "^7" - }, - "suggest": { - "ext-intl": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Idna": "lib/" - } - }, - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "IDNA normalization library", - "homepage": "https://www.horde.org", - "support": { - "source": "https://github.com/maintaina-com/Idna/tree/v2.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/imap_client", - "version": "dev-FRAMEWORK_6_0", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Imap_Client.git", - "reference": "dd5ab98d4f4d16ff3d8cd7fbed5d0044458db876" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Imap_Client/zipball/dd5ab98d4f4d16ff3d8cd7fbed5d0044458db876", - "reference": "dd5ab98d4f4d16ff3d8cd7fbed5d0044458db876", - "shasum": "" - }, - "require": { - "ext-hash": "*", - "ext-json": "*", - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/mail": "^3 || dev-FRAMEWORK_6_0", - "horde/mime": "^3 || dev-FRAMEWORK_6_0", - "horde/secret": "^3 || dev-FRAMEWORK_6_0", - "horde/socket_client": "^3 || dev-FRAMEWORK_6_0", - "horde/stream": "^2 || dev-FRAMEWORK_6_0", - "horde/stream_filter": "^3 || dev-FRAMEWORK_6_0", - "horde/translation": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7 || ^8" - }, - "suggest": { - "ext-intl": "*", - "ext-mbstring": "*", - "horde/cache": "^3 || dev-FRAMEWORK_6_0", - "horde/compress_fast": "^2 || dev-FRAMEWORK_6_0", - "horde/crypt_blowfish": "^2 || dev-FRAMEWORK_6_0", - "horde/db": "^3 || dev-FRAMEWORK_6_0", - "horde/hashtable": "^2 || dev-FRAMEWORK_6_0", - "horde/mongo": "^2 || dev-FRAMEWORK_6_0", - "horde/pack": "^2 || dev-FRAMEWORK_6_0", - "horde/stringprep": "^2 || dev-FRAMEWORK_6_0", - "horde/support": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Imap_Client": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "IMAP client library", - "homepage": "https://www.horde.org/libraries/Horde_Imap_Client", - "support": { - "source": "https://github.com/maintaina-com/Imap_Client/tree/FRAMEWORK_6_0" - }, - "time": "2021-07-22T00:00:00+00:00" - }, - { - "name": "horde/listheaders", - "version": "v2.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/ListHeaders.git", - "reference": "0c40aada632f2f774ad4fac925b65e5c1113c4e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/ListHeaders/zipball/0c40aada632f2f774ad4fac925b65e5c1113c4e8", - "reference": "0c40aada632f2f774ad4fac925b65e5c1113c4e8", - "shasum": "" - }, - "require": { - "horde/mail": "^3", - "horde/translation": "^3", - "horde/util": "^3", - "php": "^7" - }, - "suggest": { - "horde/mime": "^3", - "horde/test": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_ListHeaders": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "List headers parsing library", - "homepage": "https://www.horde.org/libraries/Horde_ListHeaders", - "support": { - "source": "https://github.com/maintaina-com/ListHeaders/tree/v2.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/mail", - "version": "v3.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Mail.git", - "reference": "5ab9b140a75c3f479b35459f3c8052d778f80e73" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Mail/zipball/5ab9b140a75c3f479b35459f3c8052d778f80e73", - "reference": "5ab9b140a75c3f479b35459f3c8052d778f80e73", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "horde/idna": "^2", - "horde/mime": "^3", - "horde/stream_filter": "^3", - "horde/translation": "^3", - "horde/util": "^3", - "php": "^7" - }, - "suggest": { - "horde/smtp": "^2", - "horde/stream_wrapper": "^3", - "horde/test": "^3", - "pear/net_dns2": "^1.5", - "pear/net_smtp": "^1.9" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Mail": "lib/" - } - }, - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "Mail library", - "homepage": "https://www.horde.org/libraries/Horde_Mail", - "support": { - "source": "https://github.com/maintaina-com/Mail/tree/v3.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/mime", - "version": "v3.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Mime.git", - "reference": "5104d9396613bb31fe60aa1636fa973c276d2530" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Mime/zipball/5104d9396613bb31fe60aa1636fa973c276d2530", - "reference": "5104d9396613bb31fe60aa1636fa973c276d2530", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "horde/listheaders": "^2", - "horde/mail": "^3", - "horde/stream": "^2", - "horde/stream_filter": "^3", - "horde/support": "^3", - "horde/text_flowed": "^3", - "horde/translation": "^3", - "horde/util": "^3", - "php": "^7" - }, - "suggest": { - "ext-idn": "*", - "ext-intl": "*", - "horde/nls": "^3", - "horde/test": "^3", - "horde/text_filter": "^3", - "pear/net_dns2": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Mime": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "MIME library", - "homepage": "https://www.horde.org/libraries/Horde_Mime", - "support": { - "source": "https://github.com/maintaina-com/Mime/tree/v3.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/secret", - "version": "v3.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Secret.git", - "reference": "6925c393aec2e8a5399299290e87768be25520e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Secret/zipball/6925c393aec2e8a5399299290e87768be25520e4", - "reference": "6925c393aec2e8a5399299290e87768be25520e4", - "shasum": "" - }, - "require": { - "ext-hash": "*", - "horde/crypt_blowfish": "^2", - "horde/exception": "^3", - "horde/support": "^3", - "php": "^7" - }, - "suggest": { - "horde/test": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Secret": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "Secret key encryption library", - "homepage": "https://www.horde.org/libraries/Horde_Secret", - "support": { - "source": "https://github.com/maintaina-com/Secret/tree/v3.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/smtp", - "version": "dev-FRAMEWORK_6_0", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Smtp.git", - "reference": "9ed9168b64bf1fbb961b0823a36eac9a4b780d76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Smtp/zipball/9ed9168b64bf1fbb961b0823a36eac9a4b780d76", - "reference": "9ed9168b64bf1fbb961b0823a36eac9a4b780d76", - "shasum": "" - }, - "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/horde-installer-plugin": "^2 || dev-FRAMEWORK_6_0", - "horde/mail": "^3 || dev-FRAMEWORK_6_0", - "horde/socket_client": "^3 || dev-FRAMEWORK_6_0", - "horde/support": "^3 || dev-FRAMEWORK_6_0", - "horde/translation": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" - }, - "suggest": { - "horde/imap_client": "^3 || dev-FRAMEWORK_6_0", - "horde/secret": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "default-branch": true, - "type": "horde-library", - "autoload": { - "psr-0": { - "Horde_Smtp": "lib/" - } - }, - "license": [ - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "SMTP client library", - "homepage": "https://www.horde.org", - "support": { - "source": "https://github.com/maintaina-com/Smtp/tree/FRAMEWORK_6_0" - }, - "time": "2021-02-24T00:00:00+00:00" - }, - { - "name": "horde/socket_client", - "version": "v3.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Socket_Client.git", - "reference": "26eb544bf55a50e980bc7d22c11d839f07af7402" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Socket_Client/zipball/26eb544bf55a50e980bc7d22c11d839f07af7402", - "reference": "26eb544bf55a50e980bc7d22c11d839f07af7402", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "php": "^7" - }, - "suggest": { - "ext-openssl": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "lib/" - ] - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "Network socket client library", - "homepage": "https://www.horde.org", - "support": { - "source": "https://github.com/maintaina-com/Socket_Client/tree/v3.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/stream", - "version": "v2.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Stream.git", - "reference": "bbb0679816fa323a8b0b1e256113d551c32fd749" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Stream/zipball/bbb0679816fa323a8b0b1e256113d551c32fd749", - "reference": "bbb0679816fa323a8b0b1e256113d551c32fd749", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "php": "^7" - }, - "suggest": { - "horde/stream_wrapper": "^3", - "horde/test": "^3", - "horde/util": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Stream": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "PHP streams library", - "homepage": "https://www.horde.org/libraries/Horde_Stream", - "support": { - "source": "https://github.com/maintaina-com/Stream/tree/v2.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/stream_filter", - "version": "v3.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Stream_Filter.git", - "reference": "168437191dccc9beb7f878d0d603eaca34c52f39" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Stream_Filter/zipball/168437191dccc9beb7f878d0d603eaca34c52f39", - "reference": "168437191dccc9beb7f878d0d603eaca34c52f39", - "shasum": "" - }, - "require": { - "php": "^7" - }, - "suggest": { - "horde/test": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Stream_Filter": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "PHP stream filters library", - "homepage": "https://www.horde.org/libraries/Horde_Stream_Filter", - "support": { - "source": "https://github.com/maintaina-com/Stream_Filter/tree/v3.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/stream_wrapper", - "version": "v3.0.0alpha4", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Stream_Wrapper.git", - "reference": "330384cc85b120e0ee7238ed1f1c5f59d90b0b58" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Stream_Wrapper/zipball/330384cc85b120e0ee7238ed1f1c5f59d90b0b58", - "reference": "330384cc85b120e0ee7238ed1f1c5f59d90b0b58", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8" - }, - "require-dev": { - "horde/log": "^3", - "horde/test": "^3" - }, - "suggest": { - "horde/log": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Stream_Wrapper": "lib/" - }, - "psr-4": { - "Horde\\Stream\\Wrapper\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Horde\\Stream\\Wrapper\\Test\\": "test/" - } - }, - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "PHP stream wrappers library", - "homepage": "https://www.horde.org/libraries/Horde_Stream_Wrapper", - "support": { - "source": "https://github.com/maintaina-com/Stream_Wrapper/tree/v3.0.0alpha4" - }, - "time": "2021-11-19T00:00:00+00:00" - }, - { - "name": "horde/support", - "version": "v3.0.0alpha4", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Support.git", - "reference": "05aa946535a1e23d2245f6ac31dc67c3854c4054" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Support/zipball/05aa946535a1e23d2245f6ac31dc67c3854c4054", - "reference": "05aa946535a1e23d2245f6ac31dc67c3854c4054", - "shasum": "" - }, - "require": { - "horde/exception": "^3", - "horde/stream_wrapper": "^3", - "horde/util": "^3", - "php": "^7.4 || ^8" - }, - "require-dev": { - "horde/test": "^3" - }, - "suggest": { - "horde/test": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Support": "lib/" - }, - "psr-4": { - "Horde\\Support\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Horde\\Support\\Test\\": "test/" - } - }, - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jan Schneider", - "email": "jan@horde.org", - "role": "lead" - }, - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "developer" - } - ], - "description": "Supporting library", - "homepage": "https://www.horde.org/libraries/Horde_Support", - "support": { - "source": "https://github.com/maintaina-com/Support/tree/v3.0.0alpha4" - }, - "time": "2021-11-05T00:00:00+00:00" - }, - { - "name": "horde/text_flowed", - "version": "v3.0.0alpha3", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Text_Flowed.git", - "reference": "704d6ed2134e4536d9fe7a1e490dd368636e4c3a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Text_Flowed/zipball/704d6ed2134e4536d9fe7a1e490dd368636e4c3a", - "reference": "704d6ed2134e4536d9fe7a1e490dd368636e4c3a", - "shasum": "" - }, - "require": { - "horde/util": "^3", - "php": "^7" - }, - "suggest": { - "horde/test": "^3" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Text_Flowed": "lib/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "Flowed text library", - "homepage": "https://www.horde.org/libraries/Horde_Text_Flowed", - "support": { - "source": "https://github.com/maintaina-com/Text_Flowed/tree/v3.0.0alpha3" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/translation", - "version": "v3.0.0alpha5", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Translation.git", - "reference": "5b6c8915fe7de4a7e8989c23379efb17cda00df8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Translation/zipball/5b6c8915fe7de4a7e8989c23379efb17cda00df8", - "reference": "5b6c8915fe7de4a7e8989c23379efb17cda00df8", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8" - }, - "require-dev": { - "horde/test": "^3" - }, - "suggest": { - "ext-gettext": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Translation": "lib/" - }, - "psr-4": { - "Horde\\Translation\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Horde\\Translation\\Test\\": "test/" - } - }, - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Jan Schneider", - "email": "jan@horde.org", - "role": "lead" - } - ], - "description": "Translation library", - "homepage": "https://www.horde.org/libraries/Horde_Translation", - "support": { - "source": "https://github.com/maintaina-com/Translation/tree/v3.0.0alpha5" - }, - "time": "2021-11-24T00:00:00+00:00" - }, - { - "name": "horde/util", - "version": "v3.0.0alpha5", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Util.git", - "reference": "7c53f3cea9679dc0f72db8bcfa7318123163403c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Util/zipball/7c53f3cea9679dc0f72db8bcfa7318123163403c", - "reference": "7c53f3cea9679dc0f72db8bcfa7318123163403c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.4 || ^8" - }, - "require-dev": { - "horde/imap_client": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "suggest": { - "ext-ctype": "*", - "ext-filter": "*", - "ext-iconv": "*", - "ext-intl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "horde/imap_client": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "type": "library", - "autoload": { - "classmap": [ - "lib/" - ], - "psr-4": { - "Horde\\Util\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Horde\\Util\\Test\\": "test/" - } - }, - "license": [ - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Jan Schneider", - "email": "jan@horde.org", - "role": "lead" - }, - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "developer" - } - ], - "description": "Utility library", - "homepage": "https://www.horde.org/libraries/Horde_Util", - "support": { - "source": "https://github.com/maintaina-com/Util/tree/v3.0.0alpha5" - }, - "time": "2022-03-10T00:00:00+00:00" - }, - { - "name": "illuminate/auth", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/auth.git", - "reference": "8f0603a1d5b90c045a1ce5365ead0f0ba20fc6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/auth/zipball/8f0603a1d5b90c045a1ce5365ead0f0ba20fc6ce", - "reference": "8f0603a1d5b90c045a1ce5365ead0f0ba20fc6ce", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/http": "5.8.*", - "illuminate/queue": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "suggest": { - "illuminate/console": "Required to use the auth:clear-resets command (5.8.*).", - "illuminate/queue": "Required to fire login / logout events (5.8.*).", - "illuminate/session": "Required to use the session based guard (5.8.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Auth\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Auth package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2020-02-14T14:28:41+00:00" - }, - { - "name": "illuminate/broadcasting", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/broadcasting.git", - "reference": "b1217ccf631e86ed17d59cdd43562555996e9a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/broadcasting/zipball/b1217ccf631e86ed17d59cdd43562555996e9a48", - "reference": "b1217ccf631e86ed17d59cdd43562555996e9a48", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/bus": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/queue": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "psr/log": "^1.0" - }, - "suggest": { - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^3.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Broadcasting\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Broadcasting package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-06-04T14:33:55+00:00" - }, - { - "name": "illuminate/bus", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/bus.git", - "reference": "6a15b03cdc6739c3f2898d67dc4fe21357d60e07" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/6a15b03cdc6739c3f2898d67dc4fe21357d60e07", - "reference": "6a15b03cdc6739c3f2898d67dc4fe21357d60e07", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/pipeline": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Bus\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Bus package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-02-18T18:37:54+00:00" - }, - { - "name": "illuminate/cache", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/cache.git", - "reference": "e6acac59f94c6362809b580918f7f3f6142d5796" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/cache/zipball/e6acac59f94c6362809b580918f7f3f6142d5796", - "reference": "e6acac59f94c6362809b580918f7f3f6142d5796", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "suggest": { - "illuminate/database": "Required to use the database cache driver (5.8.*).", - "illuminate/filesystem": "Required to use the file cache driver (5.8.*).", - "illuminate/redis": "Required to use the redis cache driver (5.8.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Cache\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Cache package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-08-18T13:53:57+00:00" - }, - { - "name": "illuminate/config", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/config.git", - "reference": "6dac1dee3fb51704767c69a07aead1bc75c12368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/config/zipball/6dac1dee3fb51704767c69a07aead1bc75c12368", - "reference": "6dac1dee3fb51704767c69a07aead1bc75c12368", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Config\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Config package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-02-14T12:51:50+00:00" - }, - { - "name": "illuminate/console", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/console.git", - "reference": "e6e4708e6c6baaf92120848e885855ab3d76f30f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/e6e4708e6c6baaf92120848e885855ab3d76f30f", - "reference": "e6e4708e6c6baaf92120848e885855ab3d76f30f", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "symfony/console": "^4.2", - "symfony/process": "^4.2" - }, - "suggest": { - "dragonmantank/cron-expression": "Required to use scheduling component (^2.0).", - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.0).", - "illuminate/filesystem": "Required to use the generator command (5.8.*)" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Console package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-08-12T13:08:28+00:00" - }, - { - "name": "illuminate/container", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/container.git", - "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/b42e5ef939144b77f78130918da0ce2d9ee16574", - "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "psr/container": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Container\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Container package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-08-20T02:00:23+00:00" - }, - { - "name": "illuminate/contracts", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "00fc6afee788fa07c311b0650ad276585f8aef96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/00fc6afee788fa07c311b0650ad276585f8aef96", - "reference": "00fc6afee788fa07c311b0650ad276585f8aef96", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-07-30T13:57:21+00:00" - }, - { - "name": "illuminate/database", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/database.git", - "reference": "ac9ae2d82b8a6137400f17b3eea258be3518daa9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/ac9ae2d82b8a6137400f17b3eea258be3518daa9", - "reference": "ac9ae2d82b8a6137400f17b3eea258be3518daa9", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", - "fzaninotto/faker": "Required to use the eloquent factory builder (^1.4).", - "illuminate/console": "Required to use the database commands (5.8.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.8.*).", - "illuminate/filesystem": "Required to use the migrations (5.8.*).", - "illuminate/pagination": "Required to paginate the result set (5.8.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Database\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Database package.", - "homepage": "https://laravel.com", - "keywords": [ - "database", - "laravel", - "orm", - "sql" - ], - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-10-03T16:22:57+00:00" - }, - { - "name": "illuminate/encryption", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/encryption.git", - "reference": "135c631bab0e0a8b9535b5750687e0a867c85193" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/encryption/zipball/135c631bab0e0a8b9535b5750687e0a867c85193", - "reference": "135c631bab0e0a8b9535b5750687e0a867c85193", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "ext-openssl": "*", - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Encryption\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Encryption package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-06-11T14:00:26+00:00" - }, - { - "name": "illuminate/events", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/events.git", - "reference": "a85d7c273bc4e3357000c5fc4812374598515de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/a85d7c273bc4e3357000c5fc4812374598515de3", - "reference": "a85d7c273bc4e3357000c5fc4812374598515de3", - "shasum": "" - }, - "require": { - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Events\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Events package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-02-18T18:37:54+00:00" - }, - { - "name": "illuminate/filesystem", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/filesystem.git", - "reference": "494ba903402d64ec49c8d869ab61791db34b2288" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/494ba903402d64ec49c8d869ab61791db34b2288", - "reference": "494ba903402d64ec49c8d869ab61791db34b2288", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "symfony/finder": "^4.2" - }, - "suggest": { - "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Filesystem package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-08-14T13:38:15+00:00" - }, - { - "name": "illuminate/hashing", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/hashing.git", - "reference": "56a9f294d9615bbbb14e2093fb0537388952cc2c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/hashing/zipball/56a9f294d9615bbbb14e2093fb0537388952cc2c", - "reference": "56a9f294d9615bbbb14e2093fb0537388952cc2c", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Hashing\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Hashing package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-02-18T18:37:54+00:00" - }, - { - "name": "illuminate/http", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/http.git", - "reference": "cd0f549611de16b323af88478b441e4d52ceef40" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/cd0f549611de16b323af88478b441e4d52ceef40", - "reference": "cd0f549611de16b323af88478b441e4d52ceef40", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/session": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "symfony/http-foundation": "^4.2", - "symfony/http-kernel": "^4.2" - }, - "suggest": { - "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image()." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Http\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Http package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-09-03T16:36:47+00:00" - }, - { - "name": "illuminate/log", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/log.git", - "reference": "1d23931e0ff74fa461fc44dc1594c66f8f6ad36b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/log/zipball/1d23931e0ff74fa461fc44dc1594c66f8f6ad36b", - "reference": "1d23931e0ff74fa461fc44dc1594c66f8f6ad36b", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "monolog/monolog": "^1.12", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Log package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-09-03T12:41:07+00:00" - }, - { - "name": "illuminate/pagination", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/pagination.git", - "reference": "391134bc87a47b3dfe5cf60df73e5e0080aec220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/391134bc87a47b3dfe5cf60df73e5e0080aec220", - "reference": "391134bc87a47b3dfe5cf60df73e5e0080aec220", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Pagination\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Pagination package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-03-18T14:45:00+00:00" - }, - { - "name": "illuminate/pipeline", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/pipeline.git", - "reference": "9e81b335d853ddd633a86a7f7e3fceed3b14f3d7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/pipeline/zipball/9e81b335d853ddd633a86a7f7e3fceed3b14f3d7", - "reference": "9e81b335d853ddd633a86a7f7e3fceed3b14f3d7", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Pipeline\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Pipeline package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-02-25T10:08:47+00:00" - }, - { - "name": "illuminate/queue", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/queue.git", - "reference": "36559f77916c16643bc614765db1e840d7bd9a00" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/queue/zipball/36559f77916c16643bc614765db1e840d7bd9a00", - "reference": "36559f77916c16643bc614765db1e840d7bd9a00", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/console": "5.8.*", - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/database": "5.8.*", - "illuminate/filesystem": "5.8.*", - "illuminate/support": "5.8.*", - "opis/closure": "^3.1", - "php": "^7.1.3", - "symfony/debug": "^4.2", - "symfony/process": "^4.2" - }, - "suggest": { - "aws/aws-sdk-php": "Required to use the SQS queue driver (^3.0).", - "ext-pcntl": "Required to use all features of the queue worker.", - "ext-posix": "Required to use all features of the queue worker.", - "illuminate/redis": "Required to use the Redis queue driver (5.8.*).", - "pda/pheanstalk": "Required to use the Beanstalk queue driver (^4.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Queue\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Queue package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-08-26T03:26:42+00:00" - }, - { - "name": "illuminate/session", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/session.git", - "reference": "087d360f7b9d75bc964280b890c2f2fe8efaf71f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/session/zipball/087d360f7b9d75bc964280b890c2f2fe8efaf71f", - "reference": "087d360f7b9d75bc964280b890c2f2fe8efaf71f", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/contracts": "5.8.*", - "illuminate/filesystem": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "symfony/finder": "^4.2", - "symfony/http-foundation": "^4.2" - }, - "suggest": { - "illuminate/console": "Required to use the session:table command (5.8.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Session\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Session package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-07-08T13:48:55+00:00" - }, - { - "name": "illuminate/support", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "df4af6a32908f1d89d74348624b57e3233eea247" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/df4af6a32908f1d89d74348624b57e3233eea247", - "reference": "df4af6a32908f1d89d74348624b57e3233eea247", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^1.1", - "ext-json": "*", - "ext-mbstring": "*", - "illuminate/contracts": "5.8.*", - "nesbot/carbon": "^1.26.3 || ^2.0", - "php": "^7.1.3" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.8.*).", - "moontoast/math": "Required to use ordered UUIDs (^1.1).", - "ramsey/uuid": "Required to use Str::uuid() (^3.7).", - "symfony/process": "Required to use the composer class (^4.2).", - "symfony/var-dumper": "Required to use the dd function (^4.2).", - "vlucas/phpdotenv": "Required to use the env helper (^3.3)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "files": [ - "helpers.php" - ], - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Support package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-12-12T14:16:47+00:00" - }, - { - "name": "illuminate/translation", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/translation.git", - "reference": "a23986a9ae77013046426bbeb4fe9a29e2527f76" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/a23986a9ae77013046426bbeb4fe9a29e2527f76", - "reference": "a23986a9ae77013046426bbeb4fe9a29e2527f76", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/contracts": "5.8.*", - "illuminate/filesystem": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Translation package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-06-04T14:33:55+00:00" - }, - { - "name": "illuminate/validation", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/validation.git", - "reference": "74e13a98299bbc3c48c5131a9239b9ad499a4efe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/validation/zipball/74e13a98299bbc3c48c5131a9239b9ad499a4efe", - "reference": "74e13a98299bbc3c48c5131a9239b9ad499a4efe", - "shasum": "" - }, - "require": { - "egulias/email-validator": "^2.0", - "ext-json": "*", - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/support": "5.8.*", - "illuminate/translation": "5.8.*", - "php": "^7.1.3", - "symfony/http-foundation": "^4.2" - }, - "suggest": { - "illuminate/database": "Required to use the database presence verifier (5.8.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Validation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Validation package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-10-24T16:01:23+00:00" - }, - { - "name": "illuminate/view", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/view.git", - "reference": "c859919bc3be97a3f114377d5d812f047b8ea90d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/c859919bc3be97a3f114377d5d812f047b8ea90d", - "reference": "c859919bc3be97a3f114377d5d812f047b8ea90d", - "shasum": "" - }, - "require": { - "ext-json": "*", - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/events": "5.8.*", - "illuminate/filesystem": "5.8.*", - "illuminate/support": "5.8.*", - "php": "^7.1.3", - "symfony/debug": "^4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\View\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate View package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2019-06-20T13:13:59+00:00" - }, - { - "name": "laravel/lumen-framework", - "version": "5.8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/laravel/lumen-framework.git", - "reference": "29099ca7a77cd9efa935070766e9a967b7c70da4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/lumen-framework/zipball/29099ca7a77cd9efa935070766e9a967b7c70da4", - "reference": "29099ca7a77cd9efa935070766e9a967b7c70da4", - "shasum": "" - }, - "require": { - "dragonmantank/cron-expression": "^2.0", - "illuminate/auth": "5.8.*", - "illuminate/broadcasting": "5.8.*", - "illuminate/bus": "5.8.*", - "illuminate/cache": "5.8.*", - "illuminate/config": "5.8.*", - "illuminate/container": "5.8.*", - "illuminate/contracts": "5.8.*", - "illuminate/database": "5.8.*", - "illuminate/encryption": "5.8.*", - "illuminate/events": "5.8.*", - "illuminate/filesystem": "5.8.*", - "illuminate/hashing": "5.8.*", - "illuminate/http": "5.8.*", - "illuminate/log": "5.8.*", - "illuminate/pagination": "5.8.*", - "illuminate/pipeline": "5.8.*", - "illuminate/queue": "5.8.*", - "illuminate/support": "5.8.*", - "illuminate/translation": "5.8.*", - "illuminate/validation": "5.8.*", - "illuminate/view": "5.8.*", - "nikic/fast-route": "^1.3", - "php": "^7.1.3", - "symfony/http-foundation": "^4.2", - "symfony/http-kernel": "^4.2", - "symfony/var-dumper": "^4.2", - "vlucas/phpdotenv": "^3.3" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0|^8.0" - }, - "suggest": { - "laravel/tinker": "Required to use the tinker console command (^1.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.8-dev" - } - }, - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Laravel\\Lumen\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "The Laravel Lumen Framework.", - "homepage": "https://lumen.laravel.com", - "keywords": [ - "framework", - "laravel", - "lumen" - ], - "support": { - "issues": "https://github.com/laravel/lumen-framework/issues", - "source": "https://github.com/laravel/lumen-framework" - }, - "time": "2019-12-02T14:37:17+00:00" - }, - { - "name": "monolog/monolog", - "version": "1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/52ebd235c1f7e0d5e1b16464b695a28335f8e44a", - "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "php-amqplib/php-amqplib": "~2.4", - "php-console/php-console": "^3.1.3", - "phpstan/phpstan": "^0.12.59", - "phpunit/phpunit": "~4.5", - "ruflin/elastica": ">=0.90 <3.0", - "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "^5.3|^6.0" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "sentry/sentry": "Allow sending log messages to a Sentry server" - }, - "type": "library", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "support": { - "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/1.27.0" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" - } - ], - "time": "2022-03-13T20:29:46+00:00" - }, - { - "name": "nesbot/carbon", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055", - "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.1.8 || ^8.0", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "doctrine/dbal": "^2.0 || ^3.0", - "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^3.0", - "kylekatarnls/multi-tester": "^2.0", - "phpmd/phpmd": "^2.9", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54 || ^1.0", - "phpunit/php-file-iterator": "^2.0.5", - "phpunit/phpunit": "^7.5.20 || ^8.5.23", - "squizlabs/php_codesniffer": "^3.4" - }, - "default-branch": true, - "bin": [ - "bin/carbon" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" - }, - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "Carbon\\": "src/Carbon/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "https://markido.com" - }, - { - "name": "kylekatarnls", - "homepage": "https://github.com/kylekatarnls" - } - ], - "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "https://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "support": { - "docs": "https://carbon.nesbot.com/docs", - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" - }, - "funding": [ - { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", - "type": "tidelift" - } - ], - "time": "2022-04-25T19:31:17+00:00" - }, - { - "name": "nikic/fast-route", - "version": "v1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "4012884e0b916e1bd895a5061d4abc3c99e283a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/4012884e0b916e1bd895a5061d4abc3c99e283a4", - "reference": "4012884e0b916e1bd895a5061d4abc3c99e283a4", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|~5.7" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "FastRoute\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ], - "support": { - "issues": "https://github.com/nikic/FastRoute/issues", - "source": "https://github.com/nikic/FastRoute/tree/v1.x" - }, - "time": "2019-12-20T12:15:33+00:00" - }, - { - "name": "opis/closure", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/opis/closure.git", - "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/3d81e4309d2a927abbe66df935f4bb60082805ad", - "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0 || ^8.0" - }, - "require-dev": { - "jeremeamia/superclosure": "^2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.6.x-dev" - } - }, - "autoload": { - "files": [ - "functions.php" - ], - "psr-4": { - "Opis\\Closure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marius Sarca", - "email": "marius.sarca@gmail.com" - }, - { - "name": "Sorin Sarca", - "email": "sarca_sorin@hotmail.com" - } - ], - "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", - "homepage": "https://opis.io/closure", - "keywords": [ - "anonymous functions", - "closure", - "function", - "serializable", - "serialization", - "serialize" - ], - "support": { - "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.3" - }, - "time": "2022-01-27T09:35:39+00:00" - }, - { - "name": "phpoption/phpoption", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "5f59b1b59025b3c66cf1ca0898247d9de39c6200" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/5f59b1b59025b3c66cf1ca0898247d9de39c6200", - "reference": "5f59b1b59025b3c66cf1ca0898247d9de39c6200", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh" - }, - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/master" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "time": "2021-12-13T23:19:03+00:00" - }, - { - "name": "psr/container", - "version": "1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, - "time": "2021-11-05T16:50:12+00:00" - }, - { - "name": "psr/log", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "time": "2021-05-03T11:20:27+00:00" - }, - { - "name": "psr/simple-cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" - }, - "time": "2017-10-23T01:57:42+00:00" - }, - { - "name": "symfony/console", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "721600488c16197bbd2d25c85002225d1b9d8c8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/721600488c16197bbd2d25c85002225d1b9d8c8c", - "reference": "721600488c16197bbd2d25c85002225d1b9d8c8c", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-09T20:12:38+00:00" - }, - { - "name": "symfony/debug", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5", - "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to ease debugging PHP code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.41" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-12T15:19:55+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "2.5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/2.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/error-handler", - "version": "5.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/error-handler.git", - "reference": "89fad74f7822ceb6aa0119b805a4a63b3f56fb31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/89fad74f7822ceb6aa0119b805a4a63b3f56fb31", - "reference": "89fad74f7822ceb6aa0119b805a4a63b3f56fb31", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "require-dev": { - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" - }, - "default-branch": true, - "bin": [ - "Resources/bin/patch-type-declarations" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\ErrorHandler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to manage errors and ease debugging PHP code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/error-handler/tree/5.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-09T21:05:45+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "708e761740c16b02c86e3f0c932018a06b895d40" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/708e761740c16b02c86e3f0c932018a06b895d40", - "reference": "708e761740c16b02c86e3f0c932018a06b895d40", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-05T15:33:49+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "1.1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/1d5cd762abaa6b2a4169d3e77610193a7157129e", - "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e", - "shasum": "" - }, - "require": { - "php": ">=7.1.3" - }, - "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/1.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:41:36+00:00" - }, - { - "name": "symfony/finder", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "40790bdf293b462798882ef6da72bb49a4a6633a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/40790bdf293b462798882ef6da72bb49a4a6633a", - "reference": "40790bdf293b462798882ef6da72bb49a4a6633a", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-14T15:36:10+00:00" - }, - { - "name": "symfony/http-client-contracts", - "version": "2.5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70", - "reference": "ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/http-client-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\HttpClient\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to HTTP clients", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/2.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-12T15:48:08+00:00" - }, - { - "name": "symfony/http-foundation", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "27441220aebeb096b4eb8267acaaa7feb5e4266c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27441220aebeb096b4eb8267acaaa7feb5e4266c", - "reference": "27441220aebeb096b4eb8267acaaa7feb5e4266c", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/mime": "^4.3|^5.0", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "predis/predis": "~1.0", - "symfony/expression-language": "^3.4|^4.0|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Defines an object-oriented layer for the HTTP specification", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/http-foundation/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-21T07:22:34+00:00" - }, - { - "name": "symfony/http-kernel", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "486baf0d6e9872294844d4aa9e7acfc871ec69da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/486baf0d6e9872294844d4aa9e7acfc871ec69da", - "reference": "486baf0d6e9872294844d4aa9e7acfc871ec69da", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/log": "^1|^2", - "symfony/error-handler": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4", - "symfony/http-client-contracts": "^1.1|^2", - "symfony/http-foundation": "^4.4.30|^5.3.7", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/browser-kit": "<4.3", - "symfony/config": "<3.4", - "symfony/console": ">=5", - "symfony/dependency-injection": "<4.3", - "symfony/translation": "<4.2", - "twig/twig": "<1.43|<2.13,>=2" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^4.3|^5.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/console": "^3.4|^4.0", - "symfony/css-selector": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^4.3|^5.0", - "symfony/dom-crawler": "^3.4|^4.0|^5.0", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/finder": "^3.4|^4.0|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/routing": "^3.4|^4.0|^5.0", - "symfony/stopwatch": "^3.4|^4.0|^5.0", - "symfony/templating": "^3.4|^4.0|^5.0", - "symfony/translation": "^4.2|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "twig/twig": "^1.43|^2.13|^3.0.4" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a structured process for converting a Request into a Response", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/http-kernel/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-11T15:13:50+00:00" - }, - { - "name": "symfony/mime", - "version": "5.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "af49bc163ec3272f677bde3bc44c0d766c1fd662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/af49bc163ec3272f677bde3bc44c0d766c1fd662", - "reference": "af49bc163ec3272f677bde3bc44c0d766c1fd662", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "egulias/email-validator": "~3.0.0", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<4.4" - }, - "require-dev": { - "egulias/email-validator": "^2.1.10|^3.1", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/property-access": "^4.4|^5.1|^6.0", - "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.2|^6.0" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Mime\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows manipulating MIME messages", - "homepage": "https://symfony.com", - "keywords": [ - "mime", - "mime-type" - ], - "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.8" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-12T15:48:08+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "9fa980f4c4b0cbf0b6406832e307b9aed839876f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/9fa980f4c4b0cbf0b6406832e307b9aed839876f", - "reference": "9fa980f4c4b0cbf0b6406832e307b9aed839876f", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "f362de8d826550e6f325444cfe611def70c5c3ec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/f362de8d826550e6f325444cfe611def70c5c3ec", - "reference": "f362de8d826550e6f325444cfe611def70c5c3ec", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "cb7c57fcdec70ed4606806bfab35940b64cbaf5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/cb7c57fcdec70ed4606806bfab35940b64cbaf5d", - "reference": "cb7c57fcdec70ed4606806bfab35940b64cbaf5d", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "240259a291e16e306dbf46dfe139d50c7fcb2d34" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/240259a291e16e306dbf46dfe139d50c7fcb2d34", - "reference": "240259a291e16e306dbf46dfe139d50c7fcb2d34", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "6992c89daf2fbcae3a68d4ff65ac9f72dc18c9fa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/6992c89daf2fbcae3a68d4ff65ac9f72dc18c9fa", - "reference": "6992c89daf2fbcae3a68d4ff65ac9f72dc18c9fa", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "115f2c1357f09f65c82d5aa8399051b6d17f22eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/115f2c1357f09f65c82d5aa8399051b6d17f22eb", - "reference": "115f2c1357f09f65c82d5aa8399051b6d17f22eb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/main" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-10T07:21:04+00:00" - }, - { - "name": "symfony/process", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9eedd60225506d56e42210a70c21bb80ca8456ce", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-04T10:19:07+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "2.5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/2.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-03-13T20:07:29+00:00" - }, - { - "name": "symfony/translation", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", - "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^1.1.6|^2" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/http-kernel": "<4.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "symfony/translation-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/finder": "~2.8|~3.0|~4.0|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/intl": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^3.4|^4.0|^5.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to internationalize your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-21T07:22:34+00:00" - }, - { - "name": "symfony/translation-contracts", - "version": "2.5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1211df0afa701e45a04253110e959d4af4ef0f07" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1211df0afa701e45a04253110e959d4af4ef0f07", - "reference": "1211df0afa701e45a04253110e959d4af4ef0f07", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/translation-contracts/tree/2.5" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/var-dumper", - "version": "4.4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "5cc4d1f2d3dad9e35ecd1611229689b867fc0476" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/5cc4d1f2d3dad9e35ecd1611229689b867fc0476", - "reference": "5cc4d1f2d3dad9e35ecd1611229689b867fc0476", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", - "symfony/console": "<3.4" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/process": "^4.4|^5.0", - "twig/twig": "^1.43|^2.13|^3.0.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, - "bin": [ - "Resources/bin/var-dump-server" - ], - "type": "library", - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides mechanisms for walking through any arbitrary PHP variable", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "support": { - "source": "https://github.com/symfony/var-dumper/tree/4.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-30T18:34:00+00:00" - }, - { - "name": "vlucas/phpdotenv", - "version": "3.6.x-dev", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "5b547cdb25825f10251370f57ba5d9d924e6f68e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/5b547cdb25825f10251370f57ba5d9d924e6f68e", - "reference": "5b547cdb25825f10251370f57ba5d9d924e6f68e", - "shasum": "" - }, - "require": { - "php": "^5.4 || ^7.0 || ^8.0", - "phpoption/phpoption": "^1.5.2", - "symfony/polyfill-ctype": "^1.17" - }, - "require-dev": { - "ext-filter": "*", - "ext-pcre": "*", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.21" - }, - "suggest": { - "ext-filter": "Required to use the boolean validator.", - "ext-pcre": "Required to use most of the library." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.6-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/3.6" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "time": "2021-12-12T23:02:06+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.x" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-03-03T08:28:38+00:00" - }, - { - "name": "fakerphp/faker", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/FakerPHP/Faker.git", - "reference": "f66a262f55aea7917bb74ecc9af13777e0b19b4f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/f66a262f55aea7917bb74ecc9af13777e0b19b4f", - "reference": "f66a262f55aea7917bb74ecc9af13777e0b19b4f", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "conflict": { - "fzaninotto/faker": "*" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "doctrine/persistence": "^1.3 || ^2.0", - "ext-intl": "*", - "symfony/phpunit-bridge": "^4.4 || ^5.2" - }, - "suggest": { - "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", - "ext-curl": "Required by Faker\\Provider\\Image to download images.", - "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", - "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", - "ext-mbstring": "Required for multibyte Unicode string functionality." - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.20-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/main" - }, - "time": "2022-05-11T08:29:10+00:00" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "c4a71eb93b6d7effffc1f45edbede2cf6eb168d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/c4a71eb93b6d7effffc1f45edbede2cf6eb168d2", - "reference": "c4a71eb93b6d7effffc1f45edbede2cf6eb168d2", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0|^8.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/master" - }, - "time": "2022-02-04T09:26:57+00:00" - }, - { - "name": "mockery/mockery", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", - "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" - }, - "conflict": { - "phpunit/phpunit": "<8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "support": { - "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.0" - }, - "time": "2022-01-20T13:18:17+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "default-branch": true, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2022-03-03T13:19:32+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.13.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" - }, - "time": "2021-11-30T19:35:32+00:00" - }, - { - "name": "phar-io/manifest", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "36d8a21e851a9512db2b086dc5ac2c61308f0138" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/36d8a21e851a9512db2b086dc5ac2c61308f0138", - "reference": "36d8a21e851a9512db2b086dc5ac2c61308f0138", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2022-02-21T19:55:33+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "a0eeab580cbdf4414fef6978732510a36ed0a9d6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/a0eeab580cbdf4414fef6978732510a36ed0a9d6", - "reference": "a0eeab580cbdf4414fef6978732510a36ed0a9d6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" - }, - "time": "2021-06-25T13:47:51+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9455bde915e322a823d464a2c41e5c0de03512a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9455bde915e322a823d464a2c41e5c0de03512a6", - "reference": "9455bde915e322a823d464a2c41e5c0de03512a6", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.5", - "psalm/phar": "^4.8" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" - }, - "time": "2022-04-02T20:16:01+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c", - "reference": "5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-05-03T08:11:05+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "38b24367e1b340aa78b96d7cab042942d917bb84" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/38b24367e1b340aa78b96d7cab042942d917bb84", - "reference": "38b24367e1b340aa78b96d7cab042942d917bb84", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-11T16:23:04+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.5.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f53bae505d8e545cc23a1bbb6d66df9cbeb91f70" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f53bae505d8e545cc23a1bbb6d66df9cbeb91f70", - "reference": "f53bae505d8e545cc23a1bbb6d66df9cbeb91f70", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", - "sebastian/version": "^3.0.2" - }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.5-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-05-03T08:11:40+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:49:45+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:10:38+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "3fade0c8462024d0426a00dc1ad0a2fda0df733f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/3fade0c8462024d0426a00dc1ad0a2fda0df733f", - "reference": "3fade0c8462024d0426a00dc1ad0a2fda0df733f", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-04-14T11:24:33+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "428c31e2ea8b292aa814bc460cf28d58eba4d2ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/428c31e2ea8b292aa814bc460cf28d58eba4d2ba", - "reference": "428c31e2ea8b292aa814bc460cf28d58eba4d2ba", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-03-06T06:59:32+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-14T08:28:10+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:17:30+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0bb681ab112cdcd15dc71ea4ed7fb78e7060828b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0bb681ab112cdcd15dc71ea4ed7fb78e7060828b", - "reference": "0bb681ab112cdcd15dc71ea4ed7fb78e7060828b", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/main" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-04-11T13:39:05+00:00" - }, - { - "name": "sebastian/type", - "version": "3.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "afad3e987736f63bc54d7c923f0c1ebf247e8618" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/afad3e987736f63bc54d7c923f0c1ebf247e8618", - "reference": "afad3e987736f63bc54d7c923f0c1ebf247e8618", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-03-27T17:35:59+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "4.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "7331c4d2c41415694a92161b3204d7c765d66696" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/7331c4d2c41415694a92161b3204d7c765d66696", - "reference": "7331c4d2c41415694a92161b3204d7c765d66696", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=7.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2022-04-18T00:25:25+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "dc96b6775d038bfa31a240150ad8505bfb856c2d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/dc96b6775d038bfa31a240150ad8505bfb856c2d", - "reference": "dc96b6775d038bfa31a240150ad8505bfb856c2d", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/master" - }, - "time": "2022-04-18T06:42:29+00:00" - } - ], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "horde/imap_client": 20, - "horde/smtp": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.4" - }, - "platform-dev": [], - "plugin-api-version": "2.3.0" -} diff --git a/composer.json b/composer.json index e003a870..fcd82022 100644 --- a/composer.json +++ b/composer.json @@ -6,18 +6,17 @@ {"url": "https://horde-satis.maintaina.com", "type": "composer"} ], "require": { + "php": ">=7.4", "ezyang/htmlpurifier": "^4.11", + "laravel/lumen-framework": "5.8.*", "horde/imap_client": "dev-FRAMEWORK_6_0", - "horde/smtp": "dev-FRAMEWORK_6_0", - "php": ">=8.1", - "laravel/lumen-framework": "^8.0" + "horde/smtp": "dev-FRAMEWORK_6_0" }, "require-dev": { "fakerphp/faker": "^1.9.1", "mockery/mockery": "^1.3.1", "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "*", - "phpstan/phpstan": "1.8.9" + "squizlabs/php_codesniffer": "*" }, "license": "MIT", "autoload": { diff --git a/composer.lock b/composer.lock index 1fef8805..7de1a1a8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,93 +4,42 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "55dd8a124cd02e22cf27a779aa74dbdb", + "content-hash": "0677d35912dcf342bc573d5543b3d8a9", "packages": [ - { - "name": "brick/math", - "version": "0.10.2", - "source": { - "type": "git", - "url": "https://github.com/brick/math.git", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "4.25.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Arbitrary-precision arithmetic library", - "keywords": [ - "Arbitrary-precision", - "BigInteger", - "BigRational", - "arithmetic", - "bigdecimal", - "bignum", - "brick", - "math" - ], - "support": { - "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.10.2" - }, - "funding": [ - { - "url": "https://github.com/BenMorel", - "type": "github" - } - ], - "time": "2022-08-10T22:54:19+00:00" - }, { "name": "doctrine/inflector", - "version": "2.1.x-dev", + "version": "1.4.x-dev", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "c109eb17daf5857f9471f9d12d52a89adc220a24" + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/c109eb17daf5857f9471f9d12d52a89adc220a24", - "reference": "c109eb17daf5857f9471f9d12d52a89adc220a24", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector", + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -135,7 +84,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.1.x" + "source": "https://github.com/doctrine/inflector/tree/1.4.x" }, "funding": [ { @@ -151,7 +100,7 @@ "type": "tidelift" } ], - "time": "2022-09-07T09:09:33+00:00" + "time": "2021-04-16T17:34:40+00:00" }, { "name": "doctrine/lexer", @@ -231,32 +180,30 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v2.3.1.x-dev", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2", + "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "webmozart/assert": "^1.0" - }, - "replace": { - "mtdowling/cron-expression": "^1.0" + "php": "^7.0|^8.0" }, "require-dev": { - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-webmozart-assert": "^1.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0" + "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, "autoload": { "psr-4": { "Cron\\": "src/Cron/" @@ -267,6 +214,11 @@ "MIT" ], "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, { "name": "Chris Tankersley", "email": "chris@ctankersley.com", @@ -280,7 +232,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v2.3.1" }, "funding": [ { @@ -288,7 +240,7 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2020-10-13T00:52:37+00:00" }, { "name": "egulias/email-validator", @@ -361,30 +313,20 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.16.0", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8" + "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8", - "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75", + "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75", "shasum": "" }, "require": { - "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0" - }, - "require-dev": { - "cerdic/css-tidy": "^1.7 || ^2.0", - "simpletest/simpletest": "dev-master" - }, - "suggest": { - "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", - "ext-bcmath": "Used for unit conversion and imagecrash protection", - "ext-iconv": "Converts text to and from non-UTF-8 encodings", - "ext-tidy": "Used for pretty-printing HTML" + "php": ">=5.2" }, "type": "library", "autoload": { @@ -416,98 +358,33 @@ ], "support": { "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0" - }, - "time": "2022-09-18T07:06:19+00:00" - }, - { - "name": "graham-campbell/result-type", - "version": "1.1.x-dev", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-4": { - "GrahamCampbell\\ResultType\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "An Implementation Of The Result Type", - "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "Result Type", - "Result-Type", - "result" - ], - "support": { - "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" - } - ], - "time": "2022-07-30T15:56:11+00:00" + "time": "2021-12-25T01:21:49+00:00" }, { "name": "horde/crypt_blowfish", - "version": "v2.0.0alpha3", + "version": "v2.0.0alpha2", "source": { "type": "git", "url": "https://github.com/maintaina-com/Crypt_Blowfish.git", - "reference": "d66b76fe87936d1d203ccd11319ed4da20952d9e" + "reference": "501a2af5520e4aa64dc7b4a1563aa5193a3c33df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Crypt_Blowfish/zipball/d66b76fe87936d1d203ccd11319ed4da20952d9e", - "reference": "d66b76fe87936d1d203ccd11319ed4da20952d9e", + "url": "https://api.github.com/repos/maintaina-com/Crypt_Blowfish/zipball/501a2af5520e4aa64dc7b4a1563aa5193a3c33df", + "reference": "501a2af5520e4aa64dc7b4a1563aa5193a3c33df", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/support": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" - }, - "require-dev": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" + "horde/exception": "^3", + "horde/support": "^3", + "php": "^7" }, "suggest": { "ext-mcrypt": "*", - "ext-openssl": "*" + "ext-openssl": "*", + "horde/test": "^3" }, "type": "library", "autoload": { @@ -515,13 +392,8 @@ "Horde_Crypt_Blowfish": "lib/" } }, - "autoload-dev": { - "psr-4": { - "Horde\\Crypt\\Blowfish\\Test\\": "test/" - } - }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -533,9 +405,9 @@ "description": "Blowfish encryption library", "homepage": "https://www.horde.org/libraries/Horde_Crypt_Blowfish", "support": { - "source": "https://github.com/maintaina-com/Crypt_Blowfish/tree/v2.0.0alpha3" + "source": "https://github.com/maintaina-com/Crypt_Blowfish/tree/v2.0.0alpha2" }, - "time": "2022-10-06T00:00:00+00:00" + "time": "2021-03-13T00:00:00+00:00" }, { "name": "horde/exception", @@ -601,16 +473,16 @@ }, { "name": "horde/horde-installer-plugin", - "version": "2.5.5", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/maintaina-com/horde-installer-plugin.git", - "reference": "153ec64d16bc5d9a6063155e4583db3049adadad" + "reference": "a55619bdf2245ed4b3f00e7a692ff891629bc531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/horde-installer-plugin/zipball/153ec64d16bc5d9a6063155e4583db3049adadad", - "reference": "153ec64d16bc5d9a6063155e4583db3049adadad", + "url": "https://api.github.com/repos/maintaina-com/horde-installer-plugin/zipball/a55619bdf2245ed4b3f00e7a692ff891629bc531", + "reference": "a55619bdf2245ed4b3f00e7a692ff891629bc531", "shasum": "" }, "require": { @@ -633,34 +505,32 @@ "MIT" ], "support": { - "source": "https://github.com/maintaina-com/horde-installer-plugin/tree/2.5.5", - "issues": "https://github.com/maintaina-com/horde-installer-plugin/issues" + "source": "https://github.com/maintaina-com/horde-installer-plugin/tree/v2.3.0" }, - "time": "2022-10-13T06:31:32+00:00" + "time": "2021-11-03T17:00:53+00:00" }, { "name": "horde/idna", - "version": "dev-FRAMEWORK_6_0", + "version": "v2.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Idna.git", - "reference": "ab42a1bcc5b74ff2874e1fe3c73bb71cfa8d5f7b" + "reference": "10842cc8e8b80af35eb8eef3cfbdacc2a9ab22f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Idna/zipball/ab42a1bcc5b74ff2874e1fe3c73bb71cfa8d5f7b", - "reference": "ab42a1bcc5b74ff2874e1fe3c73bb71cfa8d5f7b", + "url": "https://api.github.com/repos/maintaina-com/Idna/zipball/10842cc8e8b80af35eb8eef3cfbdacc2a9ab22f2", + "reference": "10842cc8e8b80af35eb8eef3cfbdacc2a9ab22f2", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/exception": "^3", + "horde/util": "^3", + "php": "^7" }, "suggest": { "ext-intl": "*" }, - "default-branch": true, "type": "library", "autoload": { "psr-0": { @@ -680,7 +550,7 @@ "description": "IDNA normalization library", "homepage": "https://www.horde.org", "support": { - "source": "https://github.com/maintaina-com/Idna/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/Idna/tree/v2.0.0alpha3" }, "time": "2021-03-13T00:00:00+00:00" }, @@ -690,12 +560,12 @@ "source": { "type": "git", "url": "https://github.com/maintaina-com/Imap_Client.git", - "reference": "2441a9e2b7c959bd67f8ed0cb91aba57febf3da2" + "reference": "dd5ab98d4f4d16ff3d8cd7fbed5d0044458db876" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Imap_Client/zipball/2441a9e2b7c959bd67f8ed0cb91aba57febf3da2", - "reference": "2441a9e2b7c959bd67f8ed0cb91aba57febf3da2", + "url": "https://api.github.com/repos/maintaina-com/Imap_Client/zipball/dd5ab98d4f4d16ff3d8cd7fbed5d0044458db876", + "reference": "dd5ab98d4f4d16ff3d8cd7fbed5d0044458db876", "shasum": "" }, "require": { @@ -710,7 +580,7 @@ "horde/stream_filter": "^3 || dev-FRAMEWORK_6_0", "horde/translation": "^3 || dev-FRAMEWORK_6_0", "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "php": "^7 || ^8" }, "suggest": { "ext-intl": "*", @@ -733,13 +603,8 @@ "Horde_Imap_Client": "lib/" } }, - "autoload-dev": { - "psr-4": { - "Horde\\Imap\\Client\\Test\\": "test/" - } - }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -753,33 +618,32 @@ "support": { "source": "https://github.com/maintaina-com/Imap_Client/tree/FRAMEWORK_6_0" }, - "time": "2022-10-08T00:00:00+00:00" + "time": "2021-07-22T00:00:00+00:00" }, { "name": "horde/listheaders", - "version": "dev-FRAMEWORK_6_0", + "version": "v2.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/ListHeaders.git", - "reference": "ec99c7484533e89bd77f3d7a395dc5f8c35b0eb1" + "reference": "0c40aada632f2f774ad4fac925b65e5c1113c4e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/ListHeaders/zipball/ec99c7484533e89bd77f3d7a395dc5f8c35b0eb1", - "reference": "ec99c7484533e89bd77f3d7a395dc5f8c35b0eb1", + "url": "https://api.github.com/repos/maintaina-com/ListHeaders/zipball/0c40aada632f2f774ad4fac925b65e5c1113c4e8", + "reference": "0c40aada632f2f774ad4fac925b65e5c1113c4e8", "shasum": "" }, "require": { - "horde/mail": "^3 || dev-FRAMEWORK_6_0", - "horde/translation": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/mail": "^3", + "horde/translation": "^3", + "horde/util": "^3", + "php": "^7" }, "suggest": { - "horde/mime": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0" + "horde/mime": "^3", + "horde/test": "^3" }, - "default-branch": true, "type": "library", "autoload": { "psr-0": { @@ -787,7 +651,7 @@ } }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -799,37 +663,37 @@ "description": "List headers parsing library", "homepage": "https://www.horde.org/libraries/Horde_ListHeaders", "support": { - "source": "https://github.com/maintaina-com/ListHeaders/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/ListHeaders/tree/v2.0.0alpha3" }, "time": "2021-03-13T00:00:00+00:00" }, { "name": "horde/mail", - "version": "v3.0.0alpha4", + "version": "v3.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Mail.git", - "reference": "fa899590e28aee51c46ba4061972de308eaaa527" + "reference": "5ab9b140a75c3f479b35459f3c8052d778f80e73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Mail/zipball/fa899590e28aee51c46ba4061972de308eaaa527", - "reference": "fa899590e28aee51c46ba4061972de308eaaa527", + "url": "https://api.github.com/repos/maintaina-com/Mail/zipball/5ab9b140a75c3f479b35459f3c8052d778f80e73", + "reference": "5ab9b140a75c3f479b35459f3c8052d778f80e73", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/idna": "^2 || dev-FRAMEWORK_6_0", - "horde/mime": "^3 || dev-FRAMEWORK_6_0", - "horde/stream_filter": "^3 || dev-FRAMEWORK_6_0", - "horde/translation": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/exception": "^3", + "horde/idna": "^2", + "horde/mime": "^3", + "horde/stream_filter": "^3", + "horde/translation": "^3", + "horde/util": "^3", + "php": "^7" }, "suggest": { - "horde/smtp": "^2 || dev-FRAMEWORK_6_0", - "horde/stream_wrapper": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0", + "horde/smtp": "^2", + "horde/stream_wrapper": "^3", + "horde/test": "^3", "pear/net_dns2": "^1.5", "pear/net_smtp": "^1.9" }, @@ -839,11 +703,6 @@ "Horde_Mail": "lib/" } }, - "autoload-dev": { - "psr-4": { - "Horde\\Mail\\Test\\": "test/" - } - }, "license": [ "BSD-2-Clause" ], @@ -857,48 +716,43 @@ "description": "Mail library", "homepage": "https://www.horde.org/libraries/Horde_Mail", "support": { - "source": "https://github.com/maintaina-com/Mail/tree/v3.0.0alpha4" + "source": "https://github.com/maintaina-com/Mail/tree/v3.0.0alpha3" }, - "time": "2022-10-08T00:00:00+00:00" + "time": "2021-03-13T00:00:00+00:00" }, { "name": "horde/mime", - "version": "v3.0.0alpha5", + "version": "v3.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Mime.git", - "reference": "149617ac4f195927ad73b1665fa546c8f3e36b82" + "reference": "5104d9396613bb31fe60aa1636fa973c276d2530" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Mime/zipball/149617ac4f195927ad73b1665fa546c8f3e36b82", - "reference": "149617ac4f195927ad73b1665fa546c8f3e36b82", + "url": "https://api.github.com/repos/maintaina-com/Mime/zipball/5104d9396613bb31fe60aa1636fa973c276d2530", + "reference": "5104d9396613bb31fe60aa1636fa973c276d2530", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/listheaders": "^2 || dev-FRAMEWORK_6_0", - "horde/mail": "^3 || dev-FRAMEWORK_6_0", - "horde/stream": "^2 || dev-FRAMEWORK_6_0", - "horde/stream_filter": "^3 || dev-FRAMEWORK_6_0", - "horde/support": "^3 || dev-FRAMEWORK_6_0", - "horde/text_filter": "^3 || dev-FRAMEWORK_6_0", - "horde/text_flowed": "^3 || dev-FRAMEWORK_6_0", - "horde/translation": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" - }, - "require-dev": { - "ext-intl": "*", - "horde/nls": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0", - "horde/text_filter": "^3 || dev-FRAMEWORK_6_0", - "pear/net_dns2": "^1.5.3" + "horde/exception": "^3", + "horde/listheaders": "^2", + "horde/mail": "^3", + "horde/stream": "^2", + "horde/stream_filter": "^3", + "horde/support": "^3", + "horde/text_flowed": "^3", + "horde/translation": "^3", + "horde/util": "^3", + "php": "^7" }, "suggest": { - "horde/nls": "^3 || dev-FRAMEWORK_6_0", - "horde/text_filter": "^3 || dev-FRAMEWORK_6_0", - "pear/net_dns2": "^1.5.3" + "ext-idn": "*", + "ext-intl": "*", + "horde/nls": "^3", + "horde/test": "^3", + "horde/text_filter": "^3", + "pear/net_dns2": "*" }, "type": "library", "autoload": { @@ -906,13 +760,8 @@ "Horde_Mime": "lib/" } }, - "autoload-dev": { - "psr-4": { - "Horde\\Mime\\Test\\": "test/" - } - }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -929,35 +778,34 @@ "description": "MIME library", "homepage": "https://www.horde.org/libraries/Horde_Mime", "support": { - "source": "https://github.com/maintaina-com/Mime/tree/v3.0.0alpha5" + "source": "https://github.com/maintaina-com/Mime/tree/v3.0.0alpha3" }, - "time": "2022-10-09T00:00:00+00:00" + "time": "2021-03-13T00:00:00+00:00" }, { "name": "horde/secret", - "version": "dev-FRAMEWORK_6_0", + "version": "v3.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Secret.git", - "reference": "682fee1f417d057a86e1390f923d5f71fad771e2" + "reference": "6925c393aec2e8a5399299290e87768be25520e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Secret/zipball/682fee1f417d057a86e1390f923d5f71fad771e2", - "reference": "682fee1f417d057a86e1390f923d5f71fad771e2", + "url": "https://api.github.com/repos/maintaina-com/Secret/zipball/6925c393aec2e8a5399299290e87768be25520e4", + "reference": "6925c393aec2e8a5399299290e87768be25520e4", "shasum": "" }, "require": { "ext-hash": "*", - "horde/crypt_blowfish": "^2 || dev-FRAMEWORK_6_0", - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/support": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/crypt_blowfish": "^2", + "horde/exception": "^3", + "horde/support": "^3", + "php": "^7" }, "suggest": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" + "horde/test": "^3" }, - "default-branch": true, "type": "library", "autoload": { "psr-0": { @@ -965,7 +813,7 @@ } }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -982,7 +830,7 @@ "description": "Secret key encryption library", "homepage": "https://www.horde.org/libraries/Horde_Secret", "support": { - "source": "https://github.com/maintaina-com/Secret/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/Secret/tree/v3.0.0alpha3" }, "time": "2021-03-13T00:00:00+00:00" }, @@ -1041,26 +889,25 @@ }, { "name": "horde/socket_client", - "version": "dev-FRAMEWORK_6_0", + "version": "v3.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Socket_Client.git", - "reference": "70ea88be9aecabf7adce80ecede808a94c7ab599" + "reference": "26eb544bf55a50e980bc7d22c11d839f07af7402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Socket_Client/zipball/70ea88be9aecabf7adce80ecede808a94c7ab599", - "reference": "70ea88be9aecabf7adce80ecede808a94c7ab599", + "url": "https://api.github.com/repos/maintaina-com/Socket_Client/zipball/26eb544bf55a50e980bc7d22c11d839f07af7402", + "reference": "26eb544bf55a50e980bc7d22c11d839f07af7402", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/exception": "^3", + "php": "^7" }, "suggest": { "ext-openssl": "*" }, - "default-branch": true, "type": "library", "autoload": { "classmap": [ @@ -1068,7 +915,7 @@ ] }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -1080,34 +927,33 @@ "description": "Network socket client library", "homepage": "https://www.horde.org", "support": { - "source": "https://github.com/maintaina-com/Socket_Client/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/Socket_Client/tree/v3.0.0alpha3" }, "time": "2021-03-13T00:00:00+00:00" }, { "name": "horde/stream", - "version": "dev-FRAMEWORK_6_0", + "version": "v2.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Stream.git", - "reference": "d2e0ddcdc9d26f59984f3be1ec06f9950fbb2263" + "reference": "bbb0679816fa323a8b0b1e256113d551c32fd749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Stream/zipball/d2e0ddcdc9d26f59984f3be1ec06f9950fbb2263", - "reference": "d2e0ddcdc9d26f59984f3be1ec06f9950fbb2263", + "url": "https://api.github.com/repos/maintaina-com/Stream/zipball/bbb0679816fa323a8b0b1e256113d551c32fd749", + "reference": "bbb0679816fa323a8b0b1e256113d551c32fd749", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/exception": "^3", + "php": "^7" }, "suggest": { - "horde/stream_wrapper": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0" + "horde/stream_wrapper": "^3", + "horde/test": "^3", + "horde/util": "^3" }, - "default-branch": true, "type": "library", "autoload": { "psr-0": { @@ -1115,7 +961,7 @@ } }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -1127,31 +973,30 @@ "description": "PHP streams library", "homepage": "https://www.horde.org/libraries/Horde_Stream", "support": { - "source": "https://github.com/maintaina-com/Stream/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/Stream/tree/v2.0.0alpha3" }, "time": "2021-03-13T00:00:00+00:00" }, { "name": "horde/stream_filter", - "version": "dev-FRAMEWORK_6_0", + "version": "v3.0.0alpha3", "source": { "type": "git", "url": "https://github.com/maintaina-com/Stream_Filter.git", - "reference": "a525d74e3e098866458b6d2b5f535b581edefc87" + "reference": "168437191dccc9beb7f878d0d603eaca34c52f39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Stream_Filter/zipball/a525d74e3e098866458b6d2b5f535b581edefc87", - "reference": "a525d74e3e098866458b6d2b5f535b581edefc87", + "url": "https://api.github.com/repos/maintaina-com/Stream_Filter/zipball/168437191dccc9beb7f878d0d603eaca34c52f39", + "reference": "168437191dccc9beb7f878d0d603eaca34c52f39", "shasum": "" }, "require": { - "php": "^7.4 || ^8" + "php": "^7" }, "suggest": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" + "horde/test": "^3" }, - "default-branch": true, "type": "library", "autoload": { "psr-0": { @@ -1159,7 +1004,7 @@ } }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -1176,7 +1021,7 @@ "description": "PHP stream filters library", "homepage": "https://www.horde.org/libraries/Horde_Stream_Filter", "support": { - "source": "https://github.com/maintaina-com/Stream_Filter/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/Stream_Filter/tree/v3.0.0alpha3" }, "time": "2021-03-13T00:00:00+00:00" }, @@ -1242,29 +1087,29 @@ }, { "name": "horde/support", - "version": "v3.0.0.1alpha4", + "version": "v3.0.0alpha4", "source": { "type": "git", "url": "https://github.com/maintaina-com/Support.git", - "reference": "5c314076103ae102039f53dd8cd6fd6bc2e07d78" + "reference": "05aa946535a1e23d2245f6ac31dc67c3854c4054" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Support/zipball/5c314076103ae102039f53dd8cd6fd6bc2e07d78", - "reference": "5c314076103ae102039f53dd8cd6fd6bc2e07d78", + "url": "https://api.github.com/repos/maintaina-com/Support/zipball/05aa946535a1e23d2245f6ac31dc67c3854c4054", + "reference": "05aa946535a1e23d2245f6ac31dc67c3854c4054", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/stream_wrapper": "^3 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", + "horde/exception": "^3", + "horde/stream_wrapper": "^3", + "horde/util": "^3", "php": "^7.4 || ^8" }, "require-dev": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" + "horde/test": "^3" }, "suggest": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" + "horde/test": "^3" }, "type": "library", "autoload": { @@ -1303,142 +1148,76 @@ "description": "Supporting library", "homepage": "https://www.horde.org/libraries/Horde_Support", "support": { - "source": "https://github.com/maintaina-com/Support/tree/v3.0.0.1alpha4" + "source": "https://github.com/maintaina-com/Support/tree/v3.0.0alpha4" }, "time": "2021-11-05T00:00:00+00:00" }, { - "name": "horde/text_filter", - "version": "dev-FRAMEWORK_6_0", + "name": "horde/text_flowed", + "version": "v3.0.0alpha3", "source": { "type": "git", - "url": "https://github.com/maintaina-com/Text_Filter.git", - "reference": "b8a155e48df658469064070f5b0454871cddf98f" + "url": "https://github.com/maintaina-com/Text_Flowed.git", + "reference": "704d6ed2134e4536d9fe7a1e490dd368636e4c3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Text_Filter/zipball/b8a155e48df658469064070f5b0454871cddf98f", - "reference": "b8a155e48df658469064070f5b0454871cddf98f", + "url": "https://api.github.com/repos/maintaina-com/Text_Flowed/zipball/704d6ed2134e4536d9fe7a1e490dd368636e4c3a", + "reference": "704d6ed2134e4536d9fe7a1e490dd368636e4c3a", "shasum": "" }, "require": { - "horde/exception": "^3 || dev-FRAMEWORK_6_0", - "horde/horde-installer-plugin": "^2 || dev-FRAMEWORK_6_0", - "horde/idna": "^2 || dev-FRAMEWORK_6_0", - "horde/util": "^3 || dev-FRAMEWORK_6_0", - "php": "^7.4 || ^8" + "horde/util": "^3", + "php": "^7" }, "suggest": { - "ext-tidy": "*", - "horde/test": "^3 || dev-FRAMEWORK_6_0", - "horde/text_filter_jsmin": "^2 || dev-FRAMEWORK_6_0", - "horde/text_flowed": "^3 || dev-FRAMEWORK_6_0", - "horde/translation": "^3 || dev-FRAMEWORK_6_0" + "horde/test": "^3" }, - "default-branch": true, - "type": "horde-library", + "type": "library", "autoload": { "psr-0": { - "Horde_Text_Filter": "lib/" - }, - "psr-4": { - "Horde\\Text\\Filter\\": "src/" + "Horde_Text_Flowed": "lib/" } }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ - { - "name": "Jan Schneider", - "email": "jan@horde.org", - "role": "lead" - }, - { - "name": "Chuck Hagenbuch", - "email": "chuck@horde.org", - "role": "lead" - }, { "name": "Michael Slusarz", "email": "slusarz@horde.org", - "role": "developer" + "role": "lead" } ], - "description": "Text filtering and conversion library", - "homepage": "https://www.horde.org/libraries/Horde_Text_Filter", + "description": "Flowed text library", + "homepage": "https://www.horde.org/libraries/Horde_Text_Flowed", "support": { - "source": "https://github.com/maintaina-com/Text_Filter/tree/FRAMEWORK_6_0" + "source": "https://github.com/maintaina-com/Text_Flowed/tree/v3.0.0alpha3" }, - "time": "2021-02-24T00:00:00+00:00" + "time": "2021-03-13T00:00:00+00:00" }, { - "name": "horde/text_flowed", - "version": "dev-FRAMEWORK_6_0", + "name": "horde/translation", + "version": "v3.0.0alpha5", "source": { "type": "git", - "url": "https://github.com/maintaina-com/Text_Flowed.git", - "reference": "658aef62d9e2efcc80f8e3956dae36ae4944d8d8" + "url": "https://github.com/maintaina-com/Translation.git", + "reference": "5b6c8915fe7de4a7e8989c23379efb17cda00df8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Text_Flowed/zipball/658aef62d9e2efcc80f8e3956dae36ae4944d8d8", - "reference": "658aef62d9e2efcc80f8e3956dae36ae4944d8d8", + "url": "https://api.github.com/repos/maintaina-com/Translation/zipball/5b6c8915fe7de4a7e8989c23379efb17cda00df8", + "reference": "5b6c8915fe7de4a7e8989c23379efb17cda00df8", "shasum": "" }, "require": { - "horde/util": "^3 || dev-FRAMEWORK_6_0", "php": "^7.4 || ^8" }, + "require-dev": { + "horde/test": "^3" + }, "suggest": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "default-branch": true, - "type": "library", - "autoload": { - "psr-0": { - "Horde_Text_Flowed": "lib/" - } - }, - "license": [ - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Michael Slusarz", - "email": "slusarz@horde.org", - "role": "lead" - } - ], - "description": "Flowed text library", - "homepage": "https://www.horde.org/libraries/Horde_Text_Flowed", - "support": { - "source": "https://github.com/maintaina-com/Text_Flowed/tree/FRAMEWORK_6_0" - }, - "time": "2021-03-13T00:00:00+00:00" - }, - { - "name": "horde/translation", - "version": "v3.0.0alpha2", - "source": { - "type": "git", - "url": "https://github.com/maintaina-com/Translation.git", - "reference": "062ea8a31cc21c2509f40954858c0c5d22e1eb49" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Translation/zipball/062ea8a31cc21c2509f40954858c0c5d22e1eb49", - "reference": "062ea8a31cc21c2509f40954858c0c5d22e1eb49", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8" - }, - "require-dev": { - "horde/test": "^3 || dev-FRAMEWORK_6_0" - }, - "suggest": { - "ext-gettext": "*" + "ext-gettext": "*" }, "type": "library", "autoload": { @@ -1455,7 +1234,7 @@ } }, "license": [ - "LGPL-2.1-only" + "LGPL-2.1" ], "authors": [ { @@ -1467,23 +1246,22 @@ "description": "Translation library", "homepage": "https://www.horde.org/libraries/Horde_Translation", "support": { - "source": "https://github.com/maintaina-com/Translation/tree/v3.0.0alpha2", - "issues": "https://github.com/maintaina-com/Translation/issues" + "source": "https://github.com/maintaina-com/Translation/tree/v3.0.0alpha5" }, - "time": "2022-08-19T00:00:00+00:00" + "time": "2021-11-24T00:00:00+00:00" }, { "name": "horde/util", - "version": "v3.0.0alpha7", + "version": "v3.0.0alpha5", "source": { "type": "git", "url": "https://github.com/maintaina-com/Util.git", - "reference": "7db8e9d436b1755295479891f2c05a4bb97beeea" + "reference": "7c53f3cea9679dc0f72db8bcfa7318123163403c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maintaina-com/Util/zipball/7db8e9d436b1755295479891f2c05a4bb97beeea", - "reference": "7db8e9d436b1755295479891f2c05a4bb97beeea", + "url": "https://api.github.com/repos/maintaina-com/Util/zipball/7c53f3cea9679dc0f72db8bcfa7318123163403c", + "reference": "7c53f3cea9679dc0f72db8bcfa7318123163403c", "shasum": "" }, "require": { @@ -1492,8 +1270,7 @@ }, "require-dev": { "horde/imap_client": "^3 || dev-FRAMEWORK_6_0", - "horde/test": "^3 || dev-FRAMEWORK_6_0", - "pear/pear": "*" + "horde/test": "^3 || dev-FRAMEWORK_6_0" }, "suggest": { "ext-ctype": "*", @@ -1543,42 +1320,40 @@ "description": "Utility library", "homepage": "https://www.horde.org/libraries/Horde_Util", "support": { - "source": "https://github.com/maintaina-com/Util/tree/v3.0.0alpha7" + "source": "https://github.com/maintaina-com/Util/tree/v3.0.0alpha5" }, - "time": "2022-10-08T00:00:00+00:00" + "time": "2022-03-10T00:00:00+00:00" }, { "name": "illuminate/auth", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/auth.git", - "reference": "28e3e57f777685018374bb59bbaa54598dbdf441" + "reference": "8f0603a1d5b90c045a1ce5365ead0f0ba20fc6ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/auth/zipball/28e3e57f777685018374bb59bbaa54598dbdf441", - "reference": "28e3e57f777685018374bb59bbaa54598dbdf441", + "url": "https://api.github.com/repos/illuminate/auth/zipball/8f0603a1d5b90c045a1ce5365ead0f0ba20fc6ce", + "reference": "8f0603a1d5b90c045a1ce5365ead0f0ba20fc6ce", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/http": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/queue": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/http": "5.8.*", + "illuminate/queue": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "suggest": { - "illuminate/console": "Required to use the auth:clear-resets command (^8.0).", - "illuminate/queue": "Required to fire login / logout events (^8.0).", - "illuminate/session": "Required to use the session based guard (^8.0)." + "illuminate/console": "Required to use the auth:clear-resets command (5.8.*).", + "illuminate/queue": "Required to fire login / logout events (5.8.*).", + "illuminate/session": "Required to use the session based guard (5.8.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1602,40 +1377,38 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-09-21T21:30:03+00:00" + "time": "2020-02-14T14:28:41+00:00" }, { "name": "illuminate/broadcasting", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/broadcasting.git", - "reference": "d7c0c81bcc679c294746b161f4b834997e904cf4" + "reference": "b1217ccf631e86ed17d59cdd43562555996e9a48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/broadcasting/zipball/d7c0c81bcc679c294746b161f4b834997e904cf4", - "reference": "d7c0c81bcc679c294746b161f4b834997e904cf4", + "url": "https://api.github.com/repos/illuminate/broadcasting/zipball/b1217ccf631e86ed17d59cdd43562555996e9a48", + "reference": "b1217ccf631e86ed17d59cdd43562555996e9a48", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/bus": "^8.0", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/queue": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "psr/log": "^1.0|^2.0" + "illuminate/bus": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/queue": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "psr/log": "^1.0" }, "suggest": { - "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0|^7.0)." + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^3.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1659,36 +1432,32 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-06T14:28:26+00:00" + "time": "2019-06-04T14:33:55+00:00" }, { "name": "illuminate/bus", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "d2a8ae4bfd881086e55455e470776358eab27eae" + "reference": "6a15b03cdc6739c3f2898d67dc4fe21357d60e07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/d2a8ae4bfd881086e55455e470776358eab27eae", - "reference": "d2a8ae4bfd881086e55455e470776358eab27eae", + "url": "https://api.github.com/repos/illuminate/bus/zipball/6a15b03cdc6739c3f2898d67dc4fe21357d60e07", + "reference": "6a15b03cdc6739c3f2898d67dc4fe21357d60e07", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/pipeline": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" - }, - "suggest": { - "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." + "illuminate/contracts": "5.8.*", + "illuminate/pipeline": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1712,43 +1481,36 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-03-07T15:02:42+00:00" + "time": "2019-02-18T18:37:54+00:00" }, { "name": "illuminate/cache", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", - "reference": "7ae5b3661413dad7264b5c69037190d766bae50f" + "reference": "e6acac59f94c6362809b580918f7f3f6142d5796" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/cache/zipball/7ae5b3661413dad7264b5c69037190d766bae50f", - "reference": "7ae5b3661413dad7264b5c69037190d766bae50f", + "url": "https://api.github.com/repos/illuminate/cache/zipball/e6acac59f94c6362809b580918f7f3f6142d5796", + "reference": "e6acac59f94c6362809b580918f7f3f6142d5796", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" - }, - "provide": { - "psr/simple-cache-implementation": "1.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "suggest": { - "ext-memcached": "Required to use the memcache cache driver.", - "illuminate/database": "Required to use the database cache driver (^8.0).", - "illuminate/filesystem": "Required to use the file cache driver (^8.0).", - "illuminate/redis": "Required to use the redis cache driver (^8.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.4)." + "illuminate/database": "Required to use the database cache driver (5.8.*).", + "illuminate/filesystem": "Required to use the file cache driver (5.8.*).", + "illuminate/redis": "Required to use the redis cache driver (5.8.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1772,85 +1534,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-07-22T14:58:32+00:00" - }, - { - "name": "illuminate/collections", - "version": "8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/collections.git", - "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/705a4e1ef93cd492c45b9b3e7911cccc990a07f4", - "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" - }, - "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.4)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "files": [ - "helpers.php" - ], - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Collections package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2022-06-23T15:29:49+00:00" + "time": "2019-08-18T13:53:57+00:00" }, { "name": "illuminate/config", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", - "reference": "feac56ab7a5c70cf2dc60dffe4323eb9851f51a8" + "reference": "6dac1dee3fb51704767c69a07aead1bc75c12368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/config/zipball/feac56ab7a5c70cf2dc60dffe4323eb9851f51a8", - "reference": "feac56ab7a5c70cf2dc60dffe4323eb9851f51a8", + "url": "https://api.github.com/repos/illuminate/config/zipball/6dac1dee3fb51704767c69a07aead1bc75c12368", + "reference": "6dac1dee3fb51704767c69a07aead1bc75c12368", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1874,43 +1582,38 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-31T15:57:46+00:00" + "time": "2019-02-14T12:51:50+00:00" }, { "name": "illuminate/console", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "4aaa93223eb3bd8119157c95f58c022967826035" + "reference": "e6e4708e6c6baaf92120848e885855ab3d76f30f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/4aaa93223eb3bd8119157c95f58c022967826035", - "reference": "4aaa93223eb3bd8119157c95f58c022967826035", + "url": "https://api.github.com/repos/illuminate/console/zipball/e6e4708e6c6baaf92120848e885855ab3d76f30f", + "reference": "e6e4708e6c6baaf92120848e885855ab3d76f30f", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/console": "^5.4", - "symfony/process": "^5.4" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "symfony/console": "^4.2", + "symfony/process": "^4.2" }, "suggest": { - "dragonmantank/cron-expression": "Required to use scheduler (^3.0.2).", - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.5.5|^7.0.1).", - "illuminate/bus": "Required to use the scheduled job dispatcher (^8.0).", - "illuminate/container": "Required to use the scheduler (^8.0).", - "illuminate/filesystem": "Required to use the generator command (^8.0).", - "illuminate/queue": "Required to use closures for scheduled jobs (^8.0)." + "dragonmantank/cron-expression": "Required to use scheduling component (^2.0).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.0).", + "illuminate/filesystem": "Required to use the generator command (5.8.*)" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1934,34 +1637,32 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-04-21T22:14:18+00:00" + "time": "2019-08-12T13:08:28+00:00" }, { "name": "illuminate/container", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "14062628d05f75047c5a1360b9350028427d568e" + "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/14062628d05f75047c5a1360b9350028427d568e", - "reference": "14062628d05f75047c5a1360b9350028427d568e", + "url": "https://api.github.com/repos/illuminate/container/zipball/b42e5ef939144b77f78130918da0ce2d9ee16574", + "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "php": "^7.3|^8.0", + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", "psr/container": "^1.0" }, - "provide": { - "psr/container-implementation": "1.0" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -1985,31 +1686,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-02-02T21:03:35+00:00" + "time": "2019-08-20T02:00:23+00:00" }, { "name": "illuminate/contracts", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" + "reference": "00fc6afee788fa07c311b0650ad276585f8aef96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", - "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/00fc6afee788fa07c311b0650ad276585f8aef96", + "reference": "00fc6afee788fa07c311b0650ad276585f8aef96", "shasum": "" }, "require": { - "php": "^7.3|^8.0", + "php": "^7.1.3", "psr/container": "^1.0", "psr/simple-cache": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2033,45 +1734,41 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-13T14:47:47+00:00" + "time": "2019-07-30T13:57:21+00:00" }, { "name": "illuminate/database", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "1a5b0e4e6913415464fa2aab554a38b9e6fa44b1" + "reference": "ac9ae2d82b8a6137400f17b3eea258be3518daa9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/1a5b0e4e6913415464fa2aab554a38b9e6fa44b1", - "reference": "1a5b0e4e6913415464fa2aab554a38b9e6fa44b1", + "url": "https://api.github.com/repos/illuminate/database/zipball/ac9ae2d82b8a6137400f17b3eea258be3518daa9", + "reference": "ac9ae2d82b8a6137400f17b3eea258be3518daa9", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/console": "^5.4" + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", - "illuminate/console": "Required to use the database commands (^8.0).", - "illuminate/events": "Required to use the observers with Eloquent (^8.0).", - "illuminate/filesystem": "Required to use the migrations (^8.0).", - "illuminate/pagination": "Required to paginate the result set (^8.0).", - "symfony/finder": "Required to use Eloquent model factories (^5.4)." + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "fzaninotto/faker": "Required to use the eloquent factory builder (^1.4).", + "illuminate/console": "Required to use the database commands (5.8.*).", + "illuminate/events": "Required to use the observers with Eloquent (5.8.*).", + "illuminate/filesystem": "Required to use the migrations (5.8.*).", + "illuminate/pagination": "Required to paginate the result set (5.8.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2101,34 +1798,34 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-08-31T16:16:06+00:00" + "time": "2019-10-03T16:22:57+00:00" }, { "name": "illuminate/encryption", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/encryption.git", - "reference": "00280dc6aa204b1b6c6d4bf75936d122bd856c15" + "reference": "135c631bab0e0a8b9535b5750687e0a867c85193" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/encryption/zipball/00280dc6aa204b1b6c6d4bf75936d122bd856c15", - "reference": "00280dc6aa204b1b6c6d4bf75936d122bd856c15", + "url": "https://api.github.com/repos/illuminate/encryption/zipball/135c631bab0e0a8b9535b5750687e0a867c85193", + "reference": "135c631bab0e0a8b9535b5750687e0a867c85193", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2152,41 +1849,35 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-03-14T18:47:47+00:00" + "time": "2019-06-11T14:00:26+00:00" }, { "name": "illuminate/events", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" + "reference": "a85d7c273bc4e3357000c5fc4812374598515de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", - "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "url": "https://api.github.com/repos/illuminate/events/zipball/a85d7c273bc4e3357000c5fc4812374598515de3", + "reference": "a85d7c273bc4e3357000c5fc4812374598515de3", "shasum": "" }, "require": { - "illuminate/bus": "^8.0", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { - "files": [ - "functions.php" - ], "psr-4": { "Illuminate\\Events\\": "" } @@ -2207,45 +1898,39 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-15T14:32:50+00:00" + "time": "2019-02-18T18:37:54+00:00" }, { "name": "illuminate/filesystem", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "73db3e9a233ed587ba54f52ab8580f3c7bc872b2" + "reference": "494ba903402d64ec49c8d869ab61791db34b2288" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/73db3e9a233ed587ba54f52ab8580f3c7bc872b2", - "reference": "73db3e9a233ed587ba54f52ab8580f3c7bc872b2", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/494ba903402d64ec49c8d869ab61791db34b2288", + "reference": "494ba903402d64ec49c8d869ab61791db34b2288", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/finder": "^5.4" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "symfony/finder": "^4.2" }, "suggest": { - "ext-ftp": "Required to use the Flysystem FTP driver.", - "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", - "symfony/mime": "Required to enable support for guessing extensions (^5.4)." + "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2269,31 +1954,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-15T15:00:40+00:00" + "time": "2019-08-14T13:38:15+00:00" }, { "name": "illuminate/hashing", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/hashing.git", - "reference": "2617f4de8d0150a3f8641b086fafac8c1e0cdbf2" + "reference": "56a9f294d9615bbbb14e2093fb0537388952cc2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/hashing/zipball/2617f4de8d0150a3f8641b086fafac8c1e0cdbf2", - "reference": "2617f4de8d0150a3f8641b086fafac8c1e0cdbf2", + "url": "https://api.github.com/repos/illuminate/hashing/zipball/56a9f294d9615bbbb14e2093fb0537388952cc2c", + "reference": "56a9f294d9615bbbb14e2093fb0537388952cc2c", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2317,41 +2002,37 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-10-22T13:20:42+00:00" + "time": "2019-02-18T18:37:54+00:00" }, { "name": "illuminate/http", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", - "reference": "38b8b0c8ca5d5231df9c515f3a3e7aac5f0da9f4" + "reference": "cd0f549611de16b323af88478b441e4d52ceef40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/http/zipball/38b8b0c8ca5d5231df9c515f3a3e7aac5f0da9f4", - "reference": "38b8b0c8ca5d5231df9c515f3a3e7aac5f0da9f4", + "url": "https://api.github.com/repos/illuminate/http/zipball/cd0f549611de16b323af88478b441e4d52ceef40", + "reference": "cd0f549611de16b323af88478b441e4d52ceef40", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/session": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/http-foundation": "^5.4", - "symfony/http-kernel": "^5.4", - "symfony/mime": "^5.4" + "illuminate/session": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "symfony/http-foundation": "^4.2", + "symfony/http-kernel": "^4.2" }, "suggest": { - "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", - "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)." + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image()." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2375,32 +2056,32 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-06-10T18:50:29+00:00" + "time": "2019-09-03T16:36:47+00:00" }, { "name": "illuminate/log", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", - "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2" + "reference": "1d23931e0ff74fa461fc44dc1594c66f8f6ad36b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/log/zipball/1dbdc6aca24d1d2b5903f865bb206039d4b800b2", - "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2", + "url": "https://api.github.com/repos/illuminate/log/zipball/1d23931e0ff74fa461fc44dc1594c66f8f6ad36b", + "reference": "1d23931e0ff74fa461fc44dc1594c66f8f6ad36b", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "monolog/monolog": "^2.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "monolog/monolog": "^1.12", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2424,79 +2105,32 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-10T15:22:22+00:00" - }, - { - "name": "illuminate/macroable", - "version": "8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/macroable.git", - "reference": "aed81891a6e046fdee72edd497f822190f61c162" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", - "reference": "aed81891a6e046fdee72edd497f822190f61c162", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Macroable package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2021-11-16T13:57:03+00:00" + "time": "2019-09-03T12:41:07+00:00" }, { "name": "illuminate/pagination", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", - "reference": "16fe8dc35f9d18c58a3471469af656a02e9ab692" + "reference": "391134bc87a47b3dfe5cf60df73e5e0080aec220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/16fe8dc35f9d18c58a3471469af656a02e9ab692", - "reference": "16fe8dc35f9d18c58a3471469af656a02e9ab692", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/391134bc87a47b3dfe5cf60df73e5e0080aec220", + "reference": "391134bc87a47b3dfe5cf60df73e5e0080aec220", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2520,31 +2154,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-06-27T13:26:06+00:00" + "time": "2019-03-18T14:45:00+00:00" }, { "name": "illuminate/pipeline", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", - "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2" + "reference": "9e81b335d853ddd633a86a7f7e3fceed3b14f3d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", - "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "url": "https://api.github.com/repos/illuminate/pipeline/zipball/9e81b335d853ddd633a86a7f7e3fceed3b14f3d7", + "reference": "9e81b335d853ddd633a86a7f7e3fceed3b14f3d7", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2568,49 +2202,46 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-03-26T18:39:16+00:00" + "time": "2019-02-25T10:08:47+00:00" }, { "name": "illuminate/queue", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/queue.git", - "reference": "0023daabf67743f7a2bd8328ca2b5537d93e4ae7" + "reference": "36559f77916c16643bc614765db1e840d7bd9a00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/queue/zipball/0023daabf67743f7a2bd8328ca2b5537d93e4ae7", - "reference": "0023daabf67743f7a2bd8328ca2b5537d93e4ae7", + "url": "https://api.github.com/repos/illuminate/queue/zipball/36559f77916c16643bc614765db1e840d7bd9a00", + "reference": "36559f77916c16643bc614765db1e840d7bd9a00", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/console": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/database": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/pipeline": "^8.0", - "illuminate/support": "^8.0", - "laravel/serializable-closure": "^1.0", - "opis/closure": "^3.6", - "php": "^7.3|^8.0", - "ramsey/uuid": "^4.2.2", - "symfony/process": "^5.4" + "illuminate/console": "5.8.*", + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/database": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/support": "5.8.*", + "opis/closure": "^3.1", + "php": "^7.1.3", + "symfony/debug": "^4.2", + "symfony/process": "^4.2" }, "suggest": { - "aws/aws-sdk-php": "Required to use the SQS queue driver and DynamoDb failed job storage (^3.198.1).", + "aws/aws-sdk-php": "Required to use the SQS queue driver (^3.0).", "ext-pcntl": "Required to use all features of the queue worker.", "ext-posix": "Required to use all features of the queue worker.", - "illuminate/redis": "Required to use the Redis queue driver (^8.0).", + "illuminate/redis": "Required to use the Redis queue driver (5.8.*).", "pda/pheanstalk": "Required to use the Beanstalk queue driver (^4.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2634,39 +2265,38 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-07-21T19:36:12+00:00" + "time": "2019-08-26T03:26:42+00:00" }, { "name": "illuminate/session", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", - "reference": "9c9988d7229d888c098eebbbb9fcb8c68580411c" + "reference": "087d360f7b9d75bc964280b890c2f2fe8efaf71f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/session/zipball/9c9988d7229d888c098eebbbb9fcb8c68580411c", - "reference": "9c9988d7229d888c098eebbbb9fcb8c68580411c", + "url": "https://api.github.com/repos/illuminate/session/zipball/087d360f7b9d75bc964280b890c2f2fe8efaf71f", + "reference": "087d360f7b9d75bc964280b890c2f2fe8efaf71f", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/finder": "^5.4", - "symfony/http-foundation": "^5.4" + "illuminate/contracts": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "symfony/finder": "^4.2", + "symfony/http-foundation": "^4.2" }, "suggest": { - "illuminate/console": "Required to use the session:table command (^8.0)." + "illuminate/console": "Required to use the session:table command (5.8.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2690,48 +2320,45 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-01-13T18:28:06+00:00" + "time": "2019-07-08T13:48:55+00:00" }, { "name": "illuminate/support", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "1c79242468d3bbd9a0f7477df34f9647dde2a09b" + "reference": "df4af6a32908f1d89d74348624b57e3233eea247" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/1c79242468d3bbd9a0f7477df34f9647dde2a09b", - "reference": "1c79242468d3bbd9a0f7477df34f9647dde2a09b", + "url": "https://api.github.com/repos/illuminate/support/zipball/df4af6a32908f1d89d74348624b57e3233eea247", + "reference": "df4af6a32908f1d89d74348624b57e3233eea247", "shasum": "" }, "require": { - "doctrine/inflector": "^1.4|^2.0", + "doctrine/inflector": "^1.1", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.53.1", - "php": "^7.3|^8.0", - "voku/portable-ascii": "^1.6.1" + "illuminate/contracts": "5.8.*", + "nesbot/carbon": "^1.26.3 || ^2.0", + "php": "^7.1.3" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", - "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^5.4).", - "symfony/var-dumper": "Required to use the dd function (^5.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." + "illuminate/filesystem": "Required to use the composer class (5.8.*).", + "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "ramsey/uuid": "Required to use Str::uuid() (^3.7).", + "symfony/process": "Required to use the composer class (^4.2).", + "symfony/var-dumper": "Required to use the dd function (^4.2).", + "vlucas/phpdotenv": "Required to use the env helper (^3.3)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2758,93 +2385,33 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-09-21T21:30:03+00:00" - }, - { - "name": "illuminate/testing", - "version": "8.x-dev", - "source": { - "type": "git", - "url": "https://github.com/illuminate/testing.git", - "reference": "1c9ec9902df3b7a38b983bbf2242ce3c088de400" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/testing/zipball/1c9ec9902df3b7a38b983bbf2242ce3c088de400", - "reference": "1c9ec9902df3b7a38b983bbf2242ce3c088de400", - "shasum": "" - }, - "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" - }, - "suggest": { - "brianium/paratest": "Required to run tests in parallel (^6.0).", - "illuminate/console": "Required to assert console commands (^8.0).", - "illuminate/database": "Required to assert databases (^8.0).", - "illuminate/http": "Required to assert responses (^8.0).", - "mockery/mockery": "Required to use mocking (^1.4.4).", - "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Testing\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Testing package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2022-05-24T14:00:18+00:00" + "time": "2019-12-12T14:16:47+00:00" }, { "name": "illuminate/translation", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", - "reference": "e119d1e55351bd846579c333dd24f9a042b724b2" + "reference": "a23986a9ae77013046426bbeb4fe9a29e2527f76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/e119d1e55351bd846579c333dd24f9a042b724b2", - "reference": "e119d1e55351bd846579c333dd24f9a042b724b2", + "url": "https://api.github.com/repos/illuminate/translation/zipball/a23986a9ae77013046426bbeb4fe9a29e2527f76", + "reference": "a23986a9ae77013046426bbeb4fe9a29e2527f76", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2868,43 +2435,39 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-05-02T13:55:33+00:00" + "time": "2019-06-04T14:33:55+00:00" }, { "name": "illuminate/validation", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", - "reference": "bb104f15545a55664755f58a278c7013f835918a" + "reference": "74e13a98299bbc3c48c5131a9239b9ad499a4efe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/validation/zipball/bb104f15545a55664755f58a278c7013f835918a", - "reference": "bb104f15545a55664755f58a278c7013f835918a", + "url": "https://api.github.com/repos/illuminate/validation/zipball/74e13a98299bbc3c48c5131a9239b9ad499a4efe", + "reference": "74e13a98299bbc3c48c5131a9239b9ad499a4efe", "shasum": "" }, "require": { - "egulias/email-validator": "^2.1.10", + "egulias/email-validator": "^2.0", "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "illuminate/translation": "^8.0", - "php": "^7.3|^8.0", - "symfony/http-foundation": "^5.4", - "symfony/mime": "^5.4" + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "illuminate/translation": "5.8.*", + "php": "^7.1.3", + "symfony/http-foundation": "^4.2" }, "suggest": { - "ext-bcmath": "Required to use the multiple_of validation rule.", - "illuminate/database": "Required to use the database presence verifier (^8.0)." + "illuminate/database": "Required to use the database presence verifier (5.8.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2928,37 +2491,36 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-05-30T13:21:10+00:00" + "time": "2019-10-24T16:01:23+00:00" }, { "name": "illuminate/view", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "5e73eef48d9242532f81fadc14c816a01bfb1388" + "reference": "c859919bc3be97a3f114377d5d812f047b8ea90d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/5e73eef48d9242532f81fadc14c816a01bfb1388", - "reference": "5e73eef48d9242532f81fadc14c816a01bfb1388", + "url": "https://api.github.com/repos/illuminate/view/zipball/c859919bc3be97a3f114377d5d812f047b8ea90d", + "reference": "c859919bc3be97a3f114377d5d812f047b8ea90d", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/events": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/events": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "symfony/debug": "^4.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -2982,72 +2544,63 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-04-14T13:47:10+00:00" + "time": "2019-06-20T13:13:59+00:00" }, { "name": "laravel/lumen-framework", - "version": "8.x-dev", + "version": "5.8.x-dev", "source": { "type": "git", "url": "https://github.com/laravel/lumen-framework.git", - "reference": "be6f8f379a7ee1e39a2ff63039f042591f176c01" + "reference": "29099ca7a77cd9efa935070766e9a967b7c70da4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/lumen-framework/zipball/be6f8f379a7ee1e39a2ff63039f042591f176c01", - "reference": "be6f8f379a7ee1e39a2ff63039f042591f176c01", + "url": "https://api.github.com/repos/laravel/lumen-framework/zipball/29099ca7a77cd9efa935070766e9a967b7c70da4", + "reference": "29099ca7a77cd9efa935070766e9a967b7c70da4", "shasum": "" }, "require": { - "dragonmantank/cron-expression": "^3.0.2", - "illuminate/auth": "^8.65", - "illuminate/broadcasting": "^8.65", - "illuminate/bus": "^8.65", - "illuminate/cache": "^8.65", - "illuminate/collections": "^8.65", - "illuminate/config": "^8.65", - "illuminate/console": "^8.65", - "illuminate/container": "^8.65", - "illuminate/contracts": "^8.65", - "illuminate/database": "^8.65", - "illuminate/encryption": "^8.65", - "illuminate/events": "^8.65", - "illuminate/filesystem": "^8.65", - "illuminate/hashing": "^8.65", - "illuminate/http": "^8.65", - "illuminate/log": "^8.65", - "illuminate/macroable": "^8.65", - "illuminate/pagination": "^8.65", - "illuminate/pipeline": "^8.65", - "illuminate/queue": "^8.65", - "illuminate/support": "^8.65", - "illuminate/testing": "^8.65", - "illuminate/translation": "^8.65", - "illuminate/validation": "^8.65", - "illuminate/view": "^8.65", + "dragonmantank/cron-expression": "^2.0", + "illuminate/auth": "5.8.*", + "illuminate/broadcasting": "5.8.*", + "illuminate/bus": "5.8.*", + "illuminate/cache": "5.8.*", + "illuminate/config": "5.8.*", + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/database": "5.8.*", + "illuminate/encryption": "5.8.*", + "illuminate/events": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/hashing": "5.8.*", + "illuminate/http": "5.8.*", + "illuminate/log": "5.8.*", + "illuminate/pagination": "5.8.*", + "illuminate/pipeline": "5.8.*", + "illuminate/queue": "5.8.*", + "illuminate/support": "5.8.*", + "illuminate/translation": "5.8.*", + "illuminate/validation": "5.8.*", + "illuminate/view": "5.8.*", "nikic/fast-route": "^1.3", - "php": "^7.3|^8.0", - "symfony/console": "^5.4", - "symfony/error-handler": "^5.4", - "symfony/http-foundation": "^5.4", - "symfony/http-kernel": "^5.4", - "symfony/mime": "^5.4", - "symfony/var-dumper": "^5.4", - "vlucas/phpdotenv": "^5.2" + "php": "^7.1.3", + "symfony/http-foundation": "^4.2", + "symfony/http-kernel": "^4.2", + "symfony/var-dumper": "^4.2", + "vlucas/phpdotenv": "^3.3" }, "require-dev": { - "mockery/mockery": "^1.4.4", - "phpunit/phpunit": "^8.5.19|^9.5.8" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.0|^8.0" }, "suggest": { - "laravel/tinker": "Required to use the tinker console command (^2.0).", - "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", - "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." + "laravel/tinker": "Required to use the tinker console command (^1.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -3065,7 +2618,7 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylor@laravel.com" + "email": "taylorotwell@gmail.com" } ], "description": "The Laravel Lumen Framework.", @@ -3079,132 +2632,55 @@ "issues": "https://github.com/laravel/lumen-framework/issues", "source": "https://github.com/laravel/lumen-framework" }, - "time": "2022-08-01T22:27:41+00:00" - }, - { - "name": "laravel/serializable-closure", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/laravel/serializable-closure.git", - "reference": "e04e46a3aeff6946a06b6c06c7fa96f1461d3cf6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e04e46a3aeff6946a06b6c06c7fa96f1461d3cf6", - "reference": "e04e46a3aeff6946a06b6c06c7fa96f1461d3cf6", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "nesbot/carbon": "^2.61", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Laravel\\SerializableClosure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - }, - { - "name": "Nuno Maduro", - "email": "nuno@laravel.com" - } - ], - "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", - "keywords": [ - "closure", - "laravel", - "serializable" - ], - "support": { - "issues": "https://github.com/laravel/serializable-closure/issues", - "source": "https://github.com/laravel/serializable-closure" - }, - "time": "2022-09-08T13:51:30+00:00" + "time": "2019-12-02T14:37:17+00:00" }, { "name": "monolog/monolog", - "version": "2.x-dev", + "version": "1.x-dev", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1387e02612584ffa1a9e93384d2d63ba0a747e11" + "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1387e02612584ffa1a9e93384d2d63ba0a747e11", - "reference": "1387e02612584ffa1a9e93384d2d63ba0a747e11", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/52ebd235c1f7e0d5e1b16464b695a28335f8e44a", + "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "php": ">=5.3.0", + "psr/log": "~1.0" }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "psr/log-implementation": "1.0.0" }, "require-dev": { "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", - "elasticsearch/elasticsearch": "^7 || ^8", - "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", - "guzzlehttp/guzzle": "^7.4", - "guzzlehttp/psr7": "^2.2", - "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", - "symfony/mailer": "^5.4 || ^6", - "symfony/mime": "^5.4 || ^6" + "graylog2/gelf-php": "~1.0", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "~4.5", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-mbstring": "Allow to work properly with unicode symbols", - "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", - "ext-openssl": "Required to send log messages using SSL", - "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "ext-mongo": "Allow sending log messages to a MongoDB server", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, "autoload": { "psr-4": { "Monolog\\": "src/Monolog" @@ -3218,11 +2694,11 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" + "homepage": "http://seld.be" } ], "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "https://github.com/Seldaek/monolog", + "homepage": "http://github.com/Seldaek/monolog", "keywords": [ "log", "logging", @@ -3230,7 +2706,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.x" + "source": "https://github.com/Seldaek/monolog/tree/1.27.0" }, "funding": [ { @@ -3242,7 +2718,7 @@ "type": "tidelift" } ], - "time": "2022-10-14T15:01:04+00:00" + "time": "2022-03-13T20:29:46+00:00" }, { "name": "nesbot/carbon", @@ -3250,12 +2726,12 @@ "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bb76b610776a21c420f2d319f1c1a5f2c14fe075" + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bb76b610776a21c420f2d319f1c1a5f2c14fe075", - "reference": "bb76b610776a21c420f2d319f1c1a5f2c14fe075", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055", + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055", "shasum": "" }, "require": { @@ -3270,12 +2746,11 @@ "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "*", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.99 || ^1.7.14", - "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "phpstan/phpstan": "^0.12.54 || ^1.0", + "phpunit/php-file-iterator": "^2.0.5", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", "squizlabs/php_codesniffer": "^3.4" }, "default-branch": true, @@ -3333,19 +2808,15 @@ }, "funding": [ { - "url": "https://github.com/sponsors/kylekatarnls", - "type": "github" - }, - { - "url": "https://opencollective.com/Carbon#sponsor", - "type": "opencollective" + "url": "https://opencollective.com/Carbon", + "type": "open_collective" }, { - "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", "type": "tidelift" } ], - "time": "2022-10-07T14:28:40+00:00" + "time": "2022-04-25T19:31:17+00:00" }, { "name": "nikic/fast-route", @@ -3469,30 +2940,26 @@ "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + "reference": "5f59b1b59025b3c66cf1ca0898247d9de39c6200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/5f59b1b59025b3c66cf1ca0898247d9de39c6200", + "reference": "5f59b1b59025b3c66cf1ca0898247d9de39c6200", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0" + "php": "^7.0 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "bamarni/composer-bin-plugin": "^1.4.1", + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" }, "default-branch": true, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -3525,7 +2992,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" + "source": "https://github.com/schmittjoh/php-option/tree/master" }, "funding": [ { @@ -3537,7 +3004,7 @@ "type": "tidelift" } ], - "time": "2022-07-30T15:51:26+00:00" + "time": "2021-12-13T23:19:03+00:00" }, { "name": "psr/container", @@ -3588,35 +3055,31 @@ "time": "2021-11-05T16:50:12+00:00" }, { - "name": "psr/event-dispatcher", - "version": "dev-master", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "e275e2d67d53964a3f13e056886ecd769edee021" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/e275e2d67d53964a3f13e056886ecd769edee021", - "reference": "e275e2d67d53964a3f13e056886ecd769edee021", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "php": ">=7.2.0" - }, - "suggest": { - "fig/event-dispatcher-util": "Provides some useful PSR-14 utilities" + "php": ">=5.3.0" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\EventDispatcher\\": "src/" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3629,43 +3092,44 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Standard interfaces for event handling.", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "events", + "log", "psr", - "psr-14" + "psr-3" ], "support": { - "source": "https://github.com/php-fig/event-dispatcher/tree/master" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2022-06-29T17:22:39+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { - "name": "psr/log", - "version": "2.0.0", + "name": "psr/simple-cache", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\SimpleCache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3675,63 +3139,13 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Common interfaces for simple caching", "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" - }, - "time": "2021-07-14T16:41:46+00:00" - }, - { - "name": "psr/simple-cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", + "cache", + "caching", "psr", "psr-16", "simple-cache" @@ -3742,47 +3156,59 @@ "time": "2017-10-23T01:57:42+00:00" }, { - "name": "ramsey/collection", - "version": "1.2.2", + "name": "symfony/console", + "version": "4.4.x-dev", "source": { "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" + "url": "https://github.com/symfony/console.git", + "reference": "721600488c16197bbd2d25c85002225d1b9d8c8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", - "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "url": "https://api.github.com/repos/symfony/console/zipball/721600488c16197bbd2d25c85002225d1b9d8c8c", + "reference": "721600488c16197bbd2d25c85002225d1b9d8c8c", "shasum": "" }, "require": { - "php": "^7.3 || ^8", - "symfony/polyfill-php81": "^1.23" + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "captainhook/captainhook": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "ergebnis/composer-normalize": "^2.6", - "fakerphp/faker": "^1.5", - "hamcrest/hamcrest-php": "^2", - "jangregor/phpstan-prophecy": "^0.8", - "mockery/mockery": "^1.3", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1", - "phpstan/phpstan": "^0.12.32", - "phpstan/phpstan-mockery": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.11", - "phpunit/phpunit": "^8.5 || ^9", - "psy/psysh": "^0.10.4", - "slevomat/coding-standard": "^6.3", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" + "psr/log": "^1|^2", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "autoload": { "psr-4": { - "Ramsey\\Collection\\": "src/" - } + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3790,182 +3216,64 @@ ], "authors": [ { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "support": { - "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.2.2" - }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "time": "2021-10-10T03:01:02+00:00" - }, - { - "name": "ramsey/uuid", - "version": "4.x-dev", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "c05274984346c552b38da86089919725c46b9681" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/c05274984346c552b38da86089919725c46b9681", - "reference": "c05274984346c552b38da86089919725c46b9681", - "shasum": "" - }, - "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10", - "ext-json": "*", - "php": "^8.0", - "ramsey/collection": "^1.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "default-branch": true, - "type": "library", - "extra": { - "captainhook": { - "force-install": true - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Ramsey\\Uuid\\": "src/" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "guid", - "identifier", - "uuid" ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.x" + "source": "https://github.com/symfony/console/tree/4.4" }, "funding": [ { - "url": "https://github.com/ramsey", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-10-03T21:36:25+00:00" + "time": "2022-05-09T20:12:38+00:00" }, { - "name": "symfony/console", - "version": "5.4.x-dev", + "name": "symfony/debug", + "version": "4.4.x-dev", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "984ea2c0f45f42dfed01d2f3987b187467c4b16d" + "url": "https://github.com/symfony/debug.git", + "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/984ea2c0f45f42dfed01d2f3987b187467c4b16d", - "reference": "984ea2c0f45f42dfed01d2f3987b187467c4b16d", + "url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5", + "reference": "6637e62480b60817b9a6984154a533e8e64c6bd5", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "php": ">=7.1.3", + "psr/log": "^1|^2|^3" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" + "symfony/http-kernel": "<3.4" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/http-kernel": "^3.4|^4.0|^5.0" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Component\\Debug\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -3985,16 +3293,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", + "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], "support": { - "source": "https://github.com/symfony/console/tree/5.4" + "source": "https://github.com/symfony/debug/tree/v4.4.41" }, "funding": [ { @@ -4010,30 +3312,29 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:01:20+00:00" + "time": "2022-04-12T15:19:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "dev-main", + "version": "2.5.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "4912000e79dc2d6df029d35d8755be1ed79b6691" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/4912000e79dc2d6df029d35d8755be1ed79b6691", - "reference": "4912000e79dc2d6df029d35d8755be1ed79b6691", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.1" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4062,7 +3363,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/main" + "source": "https://github.com/symfony/deprecation-contracts/tree/2.5" }, "funding": [ { @@ -4078,7 +3379,7 @@ "type": "tidelift" } ], - "time": "2022-05-20T13:56:22+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/error-handler", @@ -4086,12 +3387,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "5fe6d42ffeb68b094df8fdbf3acf23f391cc6be0" + "reference": "89fad74f7822ceb6aa0119b805a4a63b3f56fb31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/5fe6d42ffeb68b094df8fdbf3acf23f391cc6be0", - "reference": "5fe6d42ffeb68b094df8fdbf3acf23f391cc6be0", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/89fad74f7822ceb6aa0119b805a4a63b3f56fb31", + "reference": "89fad74f7822ceb6aa0119b805a4a63b3f56fb31", "shasum": "" }, "require": { @@ -4104,6 +3405,7 @@ "symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/serializer": "^4.4|^5.0|^6.0" }, + "default-branch": true, "bin": [ "Resources/bin/patch-type-declarations" ], @@ -4149,42 +3451,43 @@ "type": "tidelift" } ], - "time": "2022-10-03T15:15:50+00:00" + "time": "2022-05-09T21:05:45+00:00" }, { "name": "symfony/event-dispatcher", - "version": "6.2.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "e30a4de35c1048b6c4d11fd2f62d5f2fdcffae7a" + "reference": "708e761740c16b02c86e3f0c932018a06b895d40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e30a4de35c1048b6c4d11fd2f62d5f2fdcffae7a", - "reference": "e30a4de35c1048b6c4d11fd2f62d5f2fdcffae7a", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/708e761740c16b02c86e3f0c932018a06b895d40", + "reference": "708e761740c16b02c86e3f0c932018a06b895d40", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=7.1.3", + "symfony/event-dispatcher-contracts": "^1.1", + "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<3.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" + "symfony/event-dispatcher-implementation": "1.1" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/error-handler": "~3.4|~4.4", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -4216,7 +3519,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/6.2" + "source": "https://github.com/symfony/event-dispatcher/tree/4.4" }, "funding": [ { @@ -4232,34 +3535,33 @@ "type": "tidelift" } ], - "time": "2022-09-21T18:43:34+00:00" + "time": "2022-05-05T15:33:49+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "dev-main", + "version": "1.1.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "6bbedcf195e1aee798d842277dd380bb48491703" + "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/6bbedcf195e1aee798d842277dd380bb48491703", - "reference": "6bbedcf195e1aee798d842277dd380bb48491703", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/1d5cd762abaa6b2a4169d3e77610193a7157129e", + "reference": "1d5cd762abaa6b2a4169d3e77610193a7157129e", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" + "php": ">=7.1.3" }, "suggest": { + "psr/event-dispatcher": "", "symfony/event-dispatcher-implementation": "" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "1.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -4296,7 +3598,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/main" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/1.1" }, "funding": [ { @@ -4312,25 +3614,24 @@ "type": "tidelift" } ], - "time": "2022-05-20T13:56:22+00:00" + "time": "2022-01-02T09:41:36+00:00" }, { "name": "symfony/finder", - "version": "5.4.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" + "reference": "40790bdf293b462798882ef6da72bb49a4a6633a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", - "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", + "url": "https://api.github.com/repos/symfony/finder/zipball/40790bdf293b462798882ef6da72bb49a4a6633a", + "reference": "40790bdf293b462798882ef6da72bb49a4a6633a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=7.1.3", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -4359,7 +3660,85 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/5.4" + "source": "https://github.com/symfony/finder/tree/4.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-14T15:36:10+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "2.5.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70", + "reference": "ba6a9f0e8f3edd190520ee3b9a958596b6ca2e70", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/2.5" }, "funding": [ { @@ -4375,39 +3754,31 @@ "type": "tidelift" } ], - "time": "2022-07-29T07:37:50+00:00" + "time": "2022-04-12T15:48:08+00:00" }, { "name": "symfony/http-foundation", - "version": "5.4.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "75bd663ff2db90141bfb733682459d5bbe9e29c3" + "reference": "27441220aebeb096b4eb8267acaaa7feb5e4266c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/75bd663ff2db90141bfb733682459d5bbe9e29c3", - "reference": "75bd663ff2db90141bfb733682459d5bbe9e29c3", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/27441220aebeb096b4eb8267acaaa7feb5e4266c", + "reference": "27441220aebeb096b4eb8267acaaa7feb5e4266c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=7.1.3", + "symfony/mime": "^4.3|^5.0", "symfony/polyfill-mbstring": "~1.1", "symfony/polyfill-php80": "^1.16" }, "require-dev": { "predis/predis": "~1.0", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" - }, - "suggest": { - "symfony/mime": "To use the file extension guesser" + "symfony/expression-language": "^3.4|^4.0|^5.0" }, "type": "library", "autoload": { @@ -4435,7 +3806,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/5.4" + "source": "https://github.com/symfony/http-foundation/tree/4.4" }, "funding": [ { @@ -4451,69 +3822,61 @@ "type": "tidelift" } ], - "time": "2022-10-12T09:43:19+00:00" + "time": "2022-04-21T07:22:34+00:00" }, { "name": "symfony/http-kernel", - "version": "5.4.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "28fbba690fc2be08c966715b9e04fdc83ab67e4a" + "reference": "486baf0d6e9872294844d4aa9e7acfc871ec69da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/28fbba690fc2be08c966715b9e04fdc83ab67e4a", - "reference": "28fbba690fc2be08c966715b9e04fdc83ab67e4a", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/486baf0d6e9872294844d4aa9e7acfc871ec69da", + "reference": "486baf0d6e9872294844d4aa9e7acfc871ec69da", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "psr/log": "^1|^2", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^5.0|^6.0", - "symfony/http-foundation": "^5.3.7|^6.0", + "symfony/error-handler": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4", + "symfony/http-client-contracts": "^1.1|^2", + "symfony/http-foundation": "^4.4.30|^5.3.7", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.0", - "symfony/config": "<5.0", - "symfony/console": "<4.4", - "symfony/dependency-injection": "<5.3", - "symfony/doctrine-bridge": "<5.0", - "symfony/form": "<5.0", - "symfony/http-client": "<5.0", - "symfony/mailer": "<5.0", - "symfony/messenger": "<5.0", - "symfony/translation": "<5.0", - "symfony/twig-bridge": "<5.0", - "symfony/validator": "<5.0", - "twig/twig": "<2.13" + "symfony/browser-kit": "<4.3", + "symfony/config": "<3.4", + "symfony/console": ">=5", + "symfony/dependency-injection": "<4.3", + "symfony/translation": "<4.2", + "twig/twig": "<1.43|<2.13,>=2" }, "provide": { "psr/log-implementation": "1.0|2.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", - "twig/twig": "^2.13|^3.0.4" + "symfony/browser-kit": "^4.3|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0", + "symfony/css-selector": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^4.3|^5.0", + "symfony/dom-crawler": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/routing": "^3.4|^4.0|^5.0", + "symfony/stopwatch": "^3.4|^4.0|^5.0", + "symfony/templating": "^3.4|^4.0|^5.0", + "symfony/translation": "^4.2|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "twig/twig": "^1.43|^2.13|^3.0.4" }, "suggest": { "symfony/browser-kit": "", @@ -4547,7 +3910,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/5.4" + "source": "https://github.com/symfony/http-kernel/tree/4.4" }, "funding": [ { @@ -4563,7 +3926,7 @@ "type": "tidelift" } ], - "time": "2022-10-12T07:43:05+00:00" + "time": "2022-05-11T15:13:50+00:00" }, { "name": "symfony/mime", @@ -4571,12 +3934,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "1c118b253bb3495d81e95a6e3ec6c2766a98a0c4" + "reference": "af49bc163ec3272f677bde3bc44c0d766c1fd662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/1c118b253bb3495d81e95a6e3ec6c2766a98a0c4", - "reference": "1c118b253bb3495d81e95a6e3ec6c2766a98a0c4", + "url": "https://api.github.com/repos/symfony/mime/zipball/af49bc163ec3272f677bde3bc44c0d766c1fd662", + "reference": "af49bc163ec3272f677bde3bc44c0d766c1fd662", "shasum": "" }, "require": { @@ -4590,8 +3953,7 @@ "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<4.4", - "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6" + "symfony/mailer": "<4.4" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1", @@ -4599,8 +3961,9 @@ "symfony/dependency-injection": "^4.4|^5.0|^6.0", "symfony/property-access": "^4.4|^5.1|^6.0", "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6" + "symfony/serializer": "^5.2|^6.0" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -4631,7 +3994,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/5.4" + "source": "https://github.com/symfony/mime/tree/v5.4.8" }, "funding": [ { @@ -4647,7 +4010,7 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:01:20+00:00" + "time": "2022-04-12T15:48:08+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4655,12 +4018,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "9fa980f4c4b0cbf0b6406832e307b9aed839876f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/9fa980f4c4b0cbf0b6406832e307b9aed839876f", + "reference": "9fa980f4c4b0cbf0b6406832e307b9aed839876f", "shasum": "" }, "require": { @@ -4714,7 +4077,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/main" }, "funding": [ { @@ -4730,24 +4093,26 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { - "name": "symfony/polyfill-intl-grapheme", + "name": "symfony/polyfill-intl-idn", "version": "dev-main", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "f362de8d826550e6f325444cfe611def70c5c3ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/f362de8d826550e6f325444cfe611def70c5c3ec", + "reference": "f362de8d826550e6f325444cfe611def70c5c3ec", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" }, "suggest": { "ext-intl": "For best performance" @@ -4768,91 +4133,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-24T11:49:31+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" + "Symfony\\Polyfill\\Intl\\Idn\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -4884,7 +4165,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/main" }, "funding": [ { @@ -4900,7 +4181,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-intl-normalizer", @@ -4908,12 +4189,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "cb7c57fcdec70ed4606806bfab35940b64cbaf5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/cb7c57fcdec70ed4606806bfab35940b64cbaf5d", + "reference": "cb7c57fcdec70ed4606806bfab35940b64cbaf5d", "shasum": "" }, "require": { @@ -4969,7 +4250,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/main" }, "funding": [ { @@ -4985,7 +4266,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -4993,12 +4274,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "240259a291e16e306dbf46dfe139d50c7fcb2d34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/240259a291e16e306dbf46dfe139d50c7fcb2d34", + "reference": "240259a291e16e306dbf46dfe139d50c7fcb2d34", "shasum": "" }, "require": { @@ -5053,7 +4334,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/main" }, "funding": [ { @@ -5069,7 +4350,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php72", @@ -5077,12 +4358,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" + "reference": "6992c89daf2fbcae3a68d4ff65ac9f72dc18c9fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/6992c89daf2fbcae3a68d4ff65ac9f72dc18c9fa", + "reference": "6992c89daf2fbcae3a68d4ff65ac9f72dc18c9fa", "shasum": "" }, "require": { @@ -5130,7 +4411,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php72/tree/main" }, "funding": [ { @@ -5146,7 +4427,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php73", @@ -5154,12 +4435,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" + "reference": "115f2c1357f09f65c82d5aa8399051b6d17f22eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/115f2c1357f09f65c82d5aa8399051b6d17f22eb", + "reference": "115f2c1357f09f65c82d5aa8399051b6d17f22eb", "shasum": "" }, "require": { @@ -5210,7 +4491,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php73/tree/main" }, "funding": [ { @@ -5226,7 +4507,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php80", @@ -5294,7 +4575,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/main" }, "funding": [ { @@ -5312,102 +4593,22 @@ ], "time": "2022-05-10T07:21:04+00:00" }, - { - "name": "symfony/polyfill-php81", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-24T11:49:31+00:00" - }, { "name": "symfony/process", - "version": "5.4.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1" + "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1", - "reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1", + "url": "https://api.github.com/repos/symfony/process/zipball/9eedd60225506d56e42210a70c21bb80ca8456ce", + "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "symfony/polyfill-php80": "^1.16" }, "type": "library", @@ -5436,7 +4637,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/5.4" + "source": "https://github.com/symfony/process/tree/4.4" }, "funding": [ { @@ -5452,7 +4653,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2022-04-04T10:19:07+00:00" }, { "name": "symfony/service-contracts", @@ -5460,12 +4661,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", "shasum": "" }, "require": { @@ -5535,137 +4736,47 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" - }, - { - "name": "symfony/string", - "version": "6.2.x-dev", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "a97632a527ba2e699a978bc5d7da3d2320e6a677" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a97632a527ba2e699a978bc5d7da3d2320e6a677", - "reference": "a97632a527ba2e699a978bc5d7da3d2320e6a677", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/6.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-10-10T09:34:55+00:00" + "time": "2022-03-13T20:07:29+00:00" }, { "name": "symfony/translation", - "version": "6.2.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "89c407bb283948fd9096764af547699a9bc33af7" + "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/89c407bb283948fd9096764af547699a9bc33af7", - "reference": "89c407bb283948fd9096764af547699a9bc33af7", + "url": "https://api.github.com/repos/symfony/translation/zipball/dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", + "reference": "dcb67eae126e74507e0b4f0b9ac6ef35b37c3331", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", + "symfony/yaml": "<3.4" }, "provide": { - "symfony/translation-implementation": "2.3|3.0" + "symfony/translation-implementation": "1.0|2.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/finder": "~2.8|~3.0|~4.0|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -5674,9 +4785,6 @@ }, "type": "library", "autoload": { - "files": [ - "Resources/functions.php" - ], "psr-4": { "Symfony\\Component\\Translation\\": "" }, @@ -5701,7 +4809,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/6.2" + "source": "https://github.com/symfony/translation/tree/4.4" }, "funding": [ { @@ -5717,33 +4825,32 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:04:14+00:00" + "time": "2022-04-21T07:22:34+00:00" }, { "name": "symfony/translation-contracts", - "version": "dev-main", + "version": "2.5.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "3345949cca10d564606f0b11e4a53f8030c3701f" + "reference": "1211df0afa701e45a04253110e959d4af4ef0f07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/3345949cca10d564606f0b11e4a53f8030c3701f", - "reference": "3345949cca10d564606f0b11e4a53f8030c3701f", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1211df0afa701e45a04253110e959d4af4ef0f07", + "reference": "1211df0afa701e45a04253110e959d4af4ef0f07", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.2.5" }, "suggest": { "symfony/translation-implementation": "" }, - "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -5753,10 +4860,7 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5783,7 +4887,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/main" + "source": "https://github.com/symfony/translation-contracts/tree/2.5" }, "funding": [ { @@ -5799,37 +4903,37 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:32:32+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/var-dumper", - "version": "5.4.x-dev", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6894d06145fefebd9a4c7272baa026a1c394a430" + "reference": "5cc4d1f2d3dad9e35ecd1611229689b867fc0476" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6894d06145fefebd9a4c7272baa026a1c394a430", - "reference": "6894d06145fefebd9a4c7272baa026a1c394a430", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/5cc4d1f2d3dad9e35ecd1611229689b867fc0476", + "reference": "5cc4d1f2d3dad9e35ecd1611229689b867fc0476", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/uid": "^5.1|^6.0", - "twig/twig": "^2.13|^3.0.4" + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.43|^2.13|^3.0.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", @@ -5872,7 +4976,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/5.4" + "source": "https://github.com/symfony/var-dumper/tree/4.4" }, "funding": [ { @@ -5880,228 +4984,92 @@ "type": "custom" }, { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-10-07T08:01:20+00:00" - }, - { - "name": "vlucas/phpdotenv", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "dd46c263f277573244c517bac125a78f67b83a98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/dd46c263f277573244c517bac125a78f67b83a98", - "reference": "dd46c263f277573244c517bac125a78f67b83a98", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" - }, - "suggest": { - "ext-filter": "Required to use the boolean validator." - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.4-dev" - } - }, - "autoload": { - "psr-4": { - "Dotenv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://github.com/vlucas" - } - ], - "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "keywords": [ - "dotenv", - "env", - "environment" - ], - "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/master" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "time": "2021-12-17T00:42:26+00:00" - }, - { - "name": "voku/portable-ascii", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/voku/portable-ascii.git", - "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", - "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" - }, - "suggest": { - "ext-intl": "Use Intl for transliterator_transliterate() support" - }, - "type": "library", - "autoload": { - "psr-4": { - "voku\\": "src/voku/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" - } - ], - "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", - "homepage": "https://github.com/voku/portable-ascii", - "keywords": [ - "ascii", - "clean", - "php" - ], - "support": { - "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.6.1" - }, - "funding": [ - { - "url": "https://www.paypal.me/moelleken", - "type": "custom" - }, - { - "url": "https://github.com/voku", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/portable-ascii", - "type": "open_collective" - }, - { - "url": "https://www.patreon.com/voku", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-01-24T18:55:24+00:00" + "time": "2022-04-30T18:34:00+00:00" }, { - "name": "webmozart/assert", - "version": "1.11.0", + "name": "vlucas/phpdotenv", + "version": "3.6.x-dev", "source": { "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "5b547cdb25825f10251370f57ba5d9d924e6f68e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/5b547cdb25825f10251370f57ba5d9d924e6f68e", + "reference": "5b547cdb25825f10251370f57ba5d9d924e6f68e", "shasum": "" }, "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" + "php": "^5.4 || ^7.0 || ^8.0", + "phpoption/phpoption": "^1.5.2", + "symfony/polyfill-ctype": "^1.17" }, "require-dev": { - "phpunit/phpunit": "^8.5.13" + "ext-filter": "*", + "ext-pcre": "*", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.21" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator.", + "ext-pcre": "Required to use most of the library." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10-dev" + "dev-master": "3.6-dev" } }, "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" + "Dotenv\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" } ], - "description": "Assertions to validate method input/output with nice error messages.", + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", "keywords": [ - "assert", - "check", - "validate" + "dotenv", + "env", + "environment" ], "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/3.6" }, - "time": "2022-06-03T18:03:27+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2021-12-12T23:02:06+00:00" } ], "packages-dev": [ @@ -6181,12 +5149,12 @@ "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "bc743e9bfa6e42375cbf79c42bbe49f5fef12c2a" + "reference": "f66a262f55aea7917bb74ecc9af13777e0b19b4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bc743e9bfa6e42375cbf79c42bbe49f5fef12c2a", - "reference": "bc743e9bfa6e42375cbf79c42bbe49f5fef12c2a", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/f66a262f55aea7917bb74ecc9af13777e0b19b4f", + "reference": "f66a262f55aea7917bb74ecc9af13777e0b19b4f", "shasum": "" }, "require": { @@ -6241,7 +5209,7 @@ "issues": "https://github.com/FakerPHP/Faker/issues", "source": "https://github.com/FakerPHP/Faker/tree/main" }, - "time": "2022-10-11T07:14:25+00:00" + "time": "2022-05-11T08:29:10+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -6249,12 +5217,12 @@ "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "f7d2c6387a887aba9ce5d131ec43349b8c4b92b5" + "reference": "c4a71eb93b6d7effffc1f45edbede2cf6eb168d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f7d2c6387a887aba9ce5d131ec43349b8c4b92b5", - "reference": "f7d2c6387a887aba9ce5d131ec43349b8c4b92b5", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/c4a71eb93b6d7effffc1f45edbede2cf6eb168d2", + "reference": "c4a71eb93b6d7effffc1f45edbede2cf6eb168d2", "shasum": "" }, "require": { @@ -6293,20 +5261,20 @@ "issues": "https://github.com/hamcrest/hamcrest-php/issues", "source": "https://github.com/hamcrest/hamcrest-php/tree/master" }, - "time": "2022-08-20T13:29:30+00:00" + "time": "2022-02-04T09:26:57+00:00" }, { "name": "mockery/mockery", - "version": "1.5.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" + "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "url": "https://api.github.com/repos/mockery/mockery/zipball/c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", + "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", "shasum": "" }, "require": { @@ -6363,9 +5331,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.1" + "source": "https://github.com/mockery/mockery/tree/1.5.0" }, - "time": "2022-09-07T15:32:08+00:00" + "time": "2022-01-20T13:18:17+00:00" }, { "name": "myclabs/deep-copy", @@ -6429,16 +5397,16 @@ }, { "name": "nikic/php-parser", - "version": "4.x-dev", + "version": "v4.13.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "2f1fd784fe5560675722a1e5cbbcece5f43bf3a0" + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2f1fd784fe5560675722a1e5cbbcece5f43bf3a0", - "reference": "2f1fd784fe5560675722a1e5cbbcece5f43bf3a0", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", "shasum": "" }, "require": { @@ -6479,9 +5447,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/4.x" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" }, - "time": "2022-09-10T20:41:13+00:00" + "time": "2021-11-30T19:35:32+00:00" }, { "name": "phar-io/manifest", @@ -6603,64 +5571,234 @@ "time": "2022-02-21T01:04:05+00:00" }, { - "name": "phpstan/phpstan", - "version": "1.9.x-dev", + "name": "phpdocumentor/reflection-common", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "515e5811cedae86c5920461fa028ed79f067e161" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "a0eeab580cbdf4414fef6978732510a36ed0a9d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/515e5811cedae86c5920461fa028ed79f067e161", - "reference": "515e5811cedae86c5920461fa028ed79f067e161", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/a0eeab580cbdf4414fef6978732510a36ed0a9d6", + "reference": "a0eeab580cbdf4414fef6978732510a36ed0a9d6", "shasum": "" }, "require": { - "php": "^7.2|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" + "php": ">=7.1" }, - "default-branch": true, - "bin": [ - "phpstan", - "phpstan.phar" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, "autoload": { - "files": [ - "bootstrap.php" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "dev", + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", "static analysis" ], "support": { - "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.x" + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" }, - "funding": [ + "time": "2021-06-25T13:47:51+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9455bde915e322a823d464a2c41e5c0de03512a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9455bde915e322a823d464a2c41e5c0de03512a6", + "reference": "9455bde915e322a823d464a2c41e5c0de03512a6", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.5", + "psalm/phar": "^4.8" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://github.com/ondrejmirtes", - "type": "github" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" }, { - "url": "https://github.com/phpstan", - "type": "github" + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2022-04-02T20:16:01+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "77a32518733312af16a44300404e945338981de3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + }, + "time": "2022-03-15T21:29:03+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" }, { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "time": "2022-10-15T14:56:09+00:00" + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" }, { "name": "phpunit/php-code-coverage", @@ -6668,19 +5806,19 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c0c5c1c0e3a0aec88a74b6fcffd359d095192be4" + "reference": "5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c0c5c1c0e3a0aec88a74b6fcffd359d095192be4", - "reference": "c0c5c1c0e3a0aec88a74b6fcffd359d095192be4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c", + "reference": "5b85faa0aedb9b1ee542d00932a3aac5d0b9f56c", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.13.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -6737,7 +5875,7 @@ "type": "github" } ], - "time": "2022-10-13T05:15:14+00:00" + "time": "2022-05-03T08:11:05+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6986,12 +6124,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b24fb30d50d8ef4c97f5e9be3132c0a96a16e5c5" + "reference": "f53bae505d8e545cc23a1bbb6d66df9cbeb91f70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b24fb30d50d8ef4c97f5e9be3132c0a96a16e5c5", - "reference": "b24fb30d50d8ef4c97f5e9be3132c0a96a16e5c5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f53bae505d8e545cc23a1bbb6d66df9cbeb91f70", + "reference": "f53bae505d8e545cc23a1bbb6d66df9cbeb91f70", "shasum": "" }, "require": { @@ -7006,6 +6144,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -7013,16 +6152,20 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", + "sebastian/comparator": "^4.0.5", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", + "sebastian/exporter": "^4.0.3", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/type": "^3.0", "sebastian/version": "^3.0.2" }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -7074,13 +6217,9 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" } ], - "time": "2022-10-13T05:08:36+00:00" + "time": "2022-05-03T08:11:40+00:00" }, { "name": "sebastian/cli-parser", @@ -7251,16 +6390,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.x-dev", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "b247957a1c8dc81a671770f74b479c0a78a818f1" + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b247957a1c8dc81a671770f74b479c0a78a818f1", - "reference": "b247957a1c8dc81a671770f74b479c0a78a818f1", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { @@ -7313,7 +6452,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" }, "funding": [ { @@ -7321,7 +6460,7 @@ "type": "github" } ], - "time": "2022-09-14T12:46:14+00:00" + "time": "2020-10-26T15:49:45+00:00" }, { "name": "sebastian/complexity", @@ -7515,12 +6654,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "428c31e2ea8b292aa814bc460cf28d58eba4d2ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/428c31e2ea8b292aa814bc460cf28d58eba4d2ba", + "reference": "428c31e2ea8b292aa814bc460cf28d58eba4d2ba", "shasum": "" }, "require": { @@ -7584,7 +6723,7 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2022-03-06T06:59:32+00:00" }, { "name": "sebastian/global-state", @@ -7821,16 +6960,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.x-dev", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e3a614438af7f71eaa6fc8e406be8a3aa5c34595" + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e3a614438af7f71eaa6fc8e406be8a3aa5c34595", - "reference": "e3a614438af7f71eaa6fc8e406be8a3aa5c34595", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { @@ -7869,10 +7008,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, "funding": [ { @@ -7880,7 +7019,7 @@ "type": "github" } ], - "time": "2022-07-30T08:13:09+00:00" + "time": "2020-10-26T13:17:30+00:00" }, { "name": "sebastian/resource-operations", @@ -7888,12 +7027,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "b7a390ae3651f7ba3675d8364bff396e87931554" + "reference": "0bb681ab112cdcd15dc71ea4ed7fb78e7060828b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/b7a390ae3651f7ba3675d8364bff396e87931554", - "reference": "b7a390ae3651f7ba3675d8364bff396e87931554", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0bb681ab112cdcd15dc71ea4ed7fb78e7060828b", + "reference": "0bb681ab112cdcd15dc71ea4ed7fb78e7060828b", "shasum": "" }, "require": { @@ -7935,20 +7074,20 @@ "type": "github" } ], - "time": "2022-06-14T05:05:56+00:00" + "time": "2022-04-11T13:39:05+00:00" }, { "name": "sebastian/type", - "version": "3.2.x-dev", + "version": "3.0.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "4d34b23933f255b0822758a44272222cac593eb4" + "reference": "afad3e987736f63bc54d7c923f0c1ebf247e8618" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/4d34b23933f255b0822758a44272222cac593eb4", - "reference": "4d34b23933f255b0822758a44272222cac593eb4", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/afad3e987736f63bc54d7c923f0c1ebf247e8618", + "reference": "afad3e987736f63bc54d7c923f0c1ebf247e8618", "shasum": "" }, "require": { @@ -7960,7 +7099,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -7983,7 +7122,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2" + "source": "https://github.com/sebastianbergmann/type/tree/3.0" }, "funding": [ { @@ -7991,7 +7130,7 @@ "type": "github" } ], - "time": "2022-10-01T05:56:17+00:00" + "time": "2022-03-27T17:35:59+00:00" }, { "name": "sebastian/version", @@ -8052,12 +7191,12 @@ "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f1d1a6805f5a85c07581abe6d1a9709f171e1b70" + "reference": "7331c4d2c41415694a92161b3204d7c765d66696" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f1d1a6805f5a85c07581abe6d1a9709f171e1b70", - "reference": "f1d1a6805f5a85c07581abe6d1a9709f171e1b70", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/7331c4d2c41415694a92161b3204d7c765d66696", + "reference": "7331c4d2c41415694a92161b3204d7c765d66696", "shasum": "" }, "require": { @@ -8093,15 +7232,14 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards", - "static analysis" + "standards" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-09-26T03:06:36+00:00" + "time": "2022-04-18T00:25:25+00:00" }, { "name": "theseer/tokenizer", @@ -8152,19 +7290,77 @@ } ], "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "dc96b6775d038bfa31a240150ad8505bfb856c2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/dc96b6775d038bfa31a240150ad8505bfb856c2d", + "reference": "dc96b6775d038bfa31a240150ad8505bfb856c2d", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/master" + }, + "time": "2022-04-18T06:42:29+00:00" } ], "aliases": [], "minimum-stability": "dev", "stability-flags": { "horde/imap_client": 20, - "horde/smtp": 20, - "phpstan/phpstan": 20 + "horde/smtp": 20 }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.0" + "php": ">=7.4" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index ec605ef1..00000000 --- a/phpstan.neon +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - level: 9 - paths: - - src - - tests diff --git a/src/Core/AbstractList.php b/src/Core/AbstractList.php deleted file mode 100644 index c1d26e00..00000000 --- a/src/Core/AbstractList.php +++ /dev/null @@ -1,304 +0,0 @@ - - * @implements ArrayAccess - */ -abstract class AbstractList implements Arrayable, ArrayAccess, Iterator, Countable -{ - /** - * @var array - */ - protected array $data = []; - - /** - * \Iterator Interface - * @var int - */ - protected int $position = 0; - - - /** - * Constructor. - * Final to allow new static(); - * - * @see make - */ - final public function __construct() - { - } - - - /** - * Factory method for easily creating instances of the implementing class. - * - * @param mixed ...$items - * - * @return static - */ - public static function make(...$items): static - { - $self = new static(); - - foreach ($items as $item) { - $self[] = $item; - } - - return $self; - } - - - /** - * Returns the class name of the entity-type this list should maintain - * entries of. - * - * @return string - */ - abstract public function getEntityType(): string; - - /** - * Applies the map function to this data and returns it. - * - * @param callable $mapFn The callable to pass to the callback submitted to - * array_map() - * - * @return array - */ - public function map(callable $mapFn): array - { - return array_map($mapFn, $this->data); - } - - - /** - * Returns the entry in this list given the callback function. - * - * @param callable $findFn A callback. Return true in the function to indicate a match. First match will - * be returned. The callback is passed the current entry. - * - * @return ?TValue - */ - public function findBy(callable $findFn): mixed - { - foreach ($this->data as $resource) { - if ($findFn($resource) === true) { - return $resource; - } - } - - return null; - } - - - /** - * Returns the element at the head of the AbstractList, or null if the list is empty. - * - * @return ?TValue - */ - public function peek(): mixed - { - $count = count($this->data); - return !$count ? null : $this->data[$count - 1]; - } - - - /** - * @param mixed $offset - * @param mixed $value - * @return void - * - * @throws OutOfBoundsException - */ - protected function doInsert(mixed $offset, mixed $value) - { - if (!is_null($offset) && !is_int($offset)) { - throw new OutOfBoundsException( - "expected integer key for \"offset\", " . - "but got type: " . (gettype($offset)) - ); - } - - if (is_null($offset)) { - $this->data[] = $value; - } else { - $this->data[$offset] = $value; - } - } - - /** - * @param mixed $value - * @return bool - * - * @throws TypeError - */ - protected function assertTypeFor(mixed $value): bool - { - $entityType = $this->getEntityType(); - - // instanceof has higher precedence, do - // (!$value instanceof $entityType) - // would also be a valid expression - if (!($value instanceof $entityType)) { - /** @var object $value */ - throw new TypeError( - "Expected type \"$entityType\" for value-argument, got " . get_class($value) - ); - } - - return true; - } - - -// ------------------------- -// ArrayAccess Interface -// ------------------------- - - /** - * @inheritdoc - * - * @throws TypeError|OutOfBoundsException if $value is not of the type defined - * with this getEntityType, or f $offset is not an int - */ - public function offsetSet(mixed $offset, mixed $value): void - { - $this->assertTypeFor($value); - $this->doInsert($offset, $value); - } - - - /** - * @inheritdoc - */ - public function offsetExists($offset): bool - { - return isset($this->data[$offset]); - } - - - /** - * @inheritdoc - */ - public function offsetUnset($offset): void - { - unset($this->data[$offset]); - } - - - /** - * @inheritdoc - */ - public function offsetGet($offset): mixed - { - return $this->data[$offset] ?? null; - } - - -// -------------------------- -// Iterator Interface -// -------------------------- - - /** - * @inheritdoc - */ - public function rewind(): void - { - $this->position = 0; - } - - /** - * @inheritdoc - */ - public function key(): int - { - return $this->position; - } - - /** - * @inheritdoc - */ - public function current(): mixed - { - return $this->data[$this->position]; - } - - /** - * @inheritdoc - */ - public function next(): void - { - $this->position++; - } - - /** - * @inheritdoc - */ - public function valid(): bool - { - return isset($this->data[$this->position]); - } - -// -------------------------- -// Iterator Interface -// -------------------------- - - /** - * @return int - */ - public function count(): int - { - return count($this->data); - } - - -// -------------------------- -// Arrayable interface -// -------------------------- - - /** - * @return array - */ - public function toArray(): array - { - return $this->data; - } -} diff --git a/src/Core/Contract/Comparable.php b/src/Core/Contract/Comparable.php deleted file mode 100644 index f6aaeff9..00000000 --- a/src/Core/Contract/Comparable.php +++ /dev/null @@ -1,50 +0,0 @@ -parameterBag = $parameterBag; + $this->parameters = $parameters; } @@ -71,57 +66,50 @@ public function __construct(ParameterBag $parameterBag) * Delegates to the ParameterBag's __call. * * @param string $method - * @param array $arguments + * @param $arguments * * @return mixed * * @throws BadMethodCallException */ - public function __call(string $method, array $arguments) + public function __call(string $method, $arguments) { - return $this->parameterBag->{$method}(...$arguments); + return $this->parameters->{$method}(...$arguments); } /** * Delegates to the ParameterBag's __get. * - * @param string $key + * @param $key * @return mixed|null */ - public function __get(string $key) + public function __get($key) { - return $this->parameterBag->{$key}; + return $this->parameters->{$key}; } /** * Delegates to the ParameterBag's has(). * - * @param string $key + * @param $key * * @return bool */ - public function has(string $key): bool + public function has($key): bool { - return $this->parameterBag->has($key); + return $this->parameters->has($key); } /** * Delegates to the ParameterBag's toJson(). * - * @return array + * @return array */ public function toJson(JsonStrategy $strategy = null): array { - return $this->parameterBag->toJson($strategy); + return $this->parameters->toJson(); } - - - /** - * Returns the ObjectDescription this resource query targets. - * @return ObjectDescription - */ - abstract public function getResourceTarget(): ObjectDescription; } diff --git a/src/Core/Util/ClassLoader.php b/src/Core/Util/ClassLoader.php deleted file mode 100644 index 206b8c53..00000000 --- a/src/Core/Util/ClassLoader.php +++ /dev/null @@ -1,87 +0,0 @@ - $args - * - * @return mixed - * - * @throws ClassNotFoundException|InvalidTypeException - */ - public function create(string $fqn, string $baseClass, array $args = []): mixed - { - $fqn = $this->load($fqn, $baseClass); - - return new $fqn(...$args); - } -} diff --git a/src/Data/Filter/Filter.php b/src/Data/Filter/Filter.php deleted file mode 100644 index d1cead6a..00000000 --- a/src/Data/Filter/Filter.php +++ /dev/null @@ -1,83 +0,0 @@ -expression = $expression; - } - - - /** - * Returns the expression this filter was configured with. - * - * @return Expression - */ - public function getExpression(): Expression - { - return $this->expression; - } - - - /** - * @inheritdoc - */ - public function toString(StringStrategy $stringStrategy = null): string - { - return $this->getExpression()->toString($stringStrategy); - } -} diff --git a/src/Data/Resource/ObjectDescription.php b/src/Data/Resource/ObjectDescription.php deleted file mode 100644 index 39e1d8e2..00000000 --- a/src/Data/Resource/ObjectDescription.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * @see ResourceQuery - */ - abstract public function getDefaultFields(): array; - - - /** - * Returns the getType() value of all the relationships available for this - * resource description, along with all associated children. - * - * @param bool $withResourceTarget If true, returns the list including the resource - * *this* ObjectDescription describes - * - * @return array - */ - public function getAllRelationshipTypes( - bool $withResourceTarget = false - ): array { - $list = $this->getAllRelationshipResourceDescriptions($withResourceTarget); - - $res = $list->map(fn(ObjectDescription $rel) => $rel->getType()); - - /** - * @var array $res - */ - return $res; - } - - - /** - * Returns the getType() value of all the relationships available for this - * resource and its child relationships, in dot-notation. - * If this resource is A, and it has the relationships to B, which has a - * relationship to C and D, the following values are returned for - * $withResourceTarget = true - *
-     * A
-     * AB
-     * ABC
-     * ABD
-     * 
- * if $withResourceTarget is set to false, the following values are returned: - *
-     * B
-     * BC
-     * BD
-     * 
- * - * Note: The method tries to avoid circular dependencies and will not visit a resource that - * has previously been visited. - * - * @param bool $withResourceTarget If true, returns the list including *this* - * - * @return array - */ - public function getAllRelationshipPaths(bool $withResourceTarget = false): array - { - $tree = []; - $visited = []; - $traverse = function ($resourceTarget, array $path = []) use (&$traverse, &$visited, &$tree) { - - $path[] = $resourceTarget->getType(); - - $relationships = $resourceTarget->getRelationships(); - - $tree[] = $path; - foreach ($relationships as $child) { - if (in_array($child, $visited)) { - continue; - } - $visited[] = $child; - $traverse($child, $path); - } - }; - - if ($withResourceTarget) { - $visited = [$this]; - $traverse($this); - } else { - foreach ($this->getRelationships() as $node) { - $traverse($node); - } - } - - return array_map(fn ($path) => implode(".", $path), $tree); - } - - - /** - * Returns all resource object description available with all relationships spawning - * from the resource object target for this instance and its related resources. - * Note: The method tries to avoid circular dependencies and will not visit a resource that - * has previously been visited. - * - * @param bool $withResourceTarget If true, returns the list including the resource - * *this* ObjectDescription describes - * - * - * @return ObjectDescriptionList - */ - public function getAllRelationshipResourceDescriptions( - bool $withResourceTarget = false - ): ObjectDescriptionList { - - $list = new ObjectDescriptionList(); - - - if ($withResourceTarget === true) { - $list[] = $this; - } - - $traverse = function ($resourceObject) use (&$list, &$traverse) { - - $t = $resourceObject->getRelationships(); - - foreach ($t as $rel) { - if ($list->findBy(fn(ObjectDescription $item) => $item->getType() === $rel->getType())) { - continue; - } - $list[] = $rel; - $traverse($rel); - } - }; - - $traverse($this); - - return $list; - } - - - /** - * @param StringStrategy|null $stringStrategy - * @return string - */ - public function toString(?StringStrategy $stringStrategy = null): string - { - return $stringStrategy ? $stringStrategy->toString($this) : $this->getType(); - } -} diff --git a/src/Data/Resource/ObjectDescriptionList.php b/src/Data/Resource/ObjectDescriptionList.php deleted file mode 100644 index 0592c829..00000000 --- a/src/Data/Resource/ObjectDescriptionList.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class ObjectDescriptionList extends AbstractList -{ - /** - * @return string - */ - public function getEntityType(): string - { - return ObjectDescription::class; - } -} diff --git a/src/Data/Sort/SortInfo.php b/src/Data/Sort/SortInfo.php deleted file mode 100644 index bcdb9fb4..00000000 --- a/src/Data/Sort/SortInfo.php +++ /dev/null @@ -1,110 +0,0 @@ -field = $field; - $this->direction = $direction; - } - - - /** - * @return string - */ - public function getField(): string - { - return $this->field; - } - - - /** - * @return SortDirection - */ - public function getDirection(): SortDirection - { - return $this->direction; - } - - - /** - * @inheritdoc - */ - public function toArray(): array - { - return [ - "field" => $this->getField(), - "direction" => $this->getDirection()->value - ]; - } - - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - if (!$strategy) { - return $this->toArray(); - } - - return $strategy->toJson($this); - } -} diff --git a/src/Data/Sort/SortInfoList.php b/src/Data/Sort/SortInfoList.php deleted file mode 100644 index 574b19aa..00000000 --- a/src/Data/Sort/SortInfoList.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ - public function toArray(): array - { - $res = []; - - foreach ($this->data as $data) { - $res[] = $data->toArray(); - } - - return $res; - } - - - /** - * @inheritdoc - * - * @return array - */ - public function toJson(JsonStrategy $strategy = null): array - { - if (!$strategy) { - return $this->toArray(); - } - - return $strategy->toJson($this); - } -} diff --git a/src/Data/Validation/Rule.php b/src/Data/Validation/Rule.php deleted file mode 100644 index 6a84f554..00000000 --- a/src/Data/Validation/Rule.php +++ /dev/null @@ -1,57 +0,0 @@ -toJson($this) : $this->toArray(); - } -} diff --git a/src/Data/Validation/ValidationErrors.php b/src/Data/Validation/ValidationErrors.php deleted file mode 100644 index 9c4d462d..00000000 --- a/src/Data/Validation/ValidationErrors.php +++ /dev/null @@ -1,57 +0,0 @@ -toJson($this) : $this->toArray(); - } -} diff --git a/src/Data/Validation/Validator.php b/src/Data/Validation/Validator.php deleted file mode 100644 index 7794bb61..00000000 --- a/src/Data/Validation/Validator.php +++ /dev/null @@ -1,53 +0,0 @@ -source = $source; - $this->details = $details; - $this->code = $code; - } - - /** - * @inheritdoc - */ - public function getSource(): ErrorSource - { - return $this->source; - } - - /** - * @inheritdoc - */ - public function getDetails(): string - { - return $this->details; - } - - /** - * @inheritdoc - */ - public function getCode(): int - { - return $this->code; - } - - - /** - * @inheritdoc - */ - public function toArray(): array - { - return [ - "code" => $this->getCode(), - "source" => $this->getSource()->toArray(), - "detail" => $this->getDetails() - ]; - } -} diff --git a/src/Error/AnonymousErrorSource.php b/src/Error/AnonymousErrorSource.php deleted file mode 100644 index de920dc7..00000000 --- a/src/Error/AnonymousErrorSource.php +++ /dev/null @@ -1,92 +0,0 @@ -source = $source; - } - - /** - * @inheritdoc - */ - public function getName(): string - { - return - "anonymous<" . - str_replace("\n", "", print_r($this->source, true)) . - ">"; - } - - /** - * @inheritdoc - */ - public function toString(StringStrategy $stringStrategy = null): string - { - if ($stringStrategy) { - return $stringStrategy->toString($this); - } - return $this->getName(); - } - - - /** - * Returns the source object this class encapsulates. - * @return object - */ - public function getSource(): object - { - return $this->source; - } - - - /** - * @inheritdoc - */ - public function toArray(): array - { - return ["pointer" => $this->getName()]; - } -} diff --git a/src/Error/ErrorObject.php b/src/Error/ErrorObject.php deleted file mode 100644 index 0a8dd7bf..00000000 --- a/src/Error/ErrorObject.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ -class ErrorObjectList extends AbstractList -{ - /** - * @inheritdoc - */ - public function getEntityType(): string - { - return ErrorObject::class; - } - - - /** - * Returns true if this list has any entries. - * - * @return bool - */ - public function hasError(): bool - { - return count($this) > 0; - } - - - /** - * @inheritdoc - */ - public function toArray(): array - { - $list = []; - foreach ($this->data as $error) { - $list[] = $error->toArray(); - } - - return $list; - } -} diff --git a/src/Error/ErrorSource.php b/src/Error/ErrorSource.php deleted file mode 100644 index aad76aba..00000000 --- a/src/Error/ErrorSource.php +++ /dev/null @@ -1,54 +0,0 @@ -getDefaultAttributes(); + $ret = []; + foreach ($def as $attr) { + if (in_array($attr, $exclude)) { + continue; + } + $ret[$attr] = true; // true or array + } - /** - * @return ObjectDescriptionList - */ - public function getRelationships(): ObjectDescriptionList - { - $list = new ObjectDescriptionList(); - $list[] = new MailFolder(); - $list[] = new MessageBody(); + foreach ($additional as $key => $fieldConf) { + $chk = $this->getAttr($key, $additional); + $chk && $ret[$key] = $chk;// true or array + } - return $list; + return $ret; } /** - * Returns all fields the entity exposes. - * * @return string[] */ - public function getFields(): array + public function getSupportedAttributes(): array { return [ + "hasAttachments", + "size", + "plain", // \ __Preview + "html", // / Text + "cc", + "bcc", + "replyTo", "from", "to", "subject", @@ -79,23 +87,15 @@ public function getFields(): array "recent", "charset", "references", - "messageId", - "size", - "hasAttachments", - "cc", - "bcc", - "replyTo", - "draftInfo" + "messageId" ]; } /** - * Default fields to pass to the lower level api. - * - * @return array + * @inheritdoc */ - public function getDefaultFields(): array + public function getDefaultAttributes(): array { return [ "from", @@ -110,8 +110,34 @@ public function getDefaultFields(): array "charset", "references", "messageId", + "plain", "size", "hasAttachments" ]; } + + + /** + * Returns the target's value at "$key" if the value is truthy, otherwise + * null or $default (if !null) is returned. + * + * @param $key + * @param $target + * @param null $default + * @return mixed|null + * @noinspection PhpSameParameterValueInspection + */ + private function getAttr($key, $target, $default = null) + { + if (array_key_exists($key, $target)) { + $val = $target[$key]; + if (is_array($val) && empty($val)) { + $val = true; + } + + return $val ?: $default; + } + + return $default; + } } diff --git a/src/Horde/Mail/Client/Imap/FilterTrait.php b/src/Horde/Mail/Client/Imap/FilterTrait.php new file mode 100644 index 00000000..9c3e6c7b --- /dev/null +++ b/src/Horde/Mail/Client/Imap/FilterTrait.php @@ -0,0 +1,97 @@ + "recent", "value" => true, "operator" => "="], + * ["property" => "id", "value" => 1000, "operator" => ">="] + * ] + * + * $this->getSearchQueryFromFilterTrait($options)->toString(); // returns "OR (UID 1000:*) (RECENT)" + * + * + * Trait FilterTrait + * @package Conjoon\Horde\Mail\Client\Imap + */ +trait FilterTrait +{ + /** + * Looks up filter information from the passed array and creates a Horde_Imap_Client_Search_Query + * from it. + * + * @param array $clientFilter + * + * @return Horde_Imap_Client_Search_Query + */ + public function getSearchQueryFromFilter(array $clientFilter): Horde_Imap_Client_Search_Query + { + $searchQuery = new Horde_Imap_Client_Search_Query(); + + // check if we have filter here + if (!empty($clientFilter)) { + $clientSearches = []; + + foreach ($clientFilter as $filter) { + if ($filter["property"] === "id") { + if ($filter["operator"] === ">=") { + $filterId = $filter["value"] . ":*"; + $latestQuery = new Horde_Imap_Client_Search_Query(); + $latestQuery->ids(new Horde_Imap_Client_Ids([$filterId])); + $clientSearches[] = $latestQuery; + } elseif (strtolower($filter["operator"]) === "in") { + $latestQuery = new Horde_Imap_Client_Search_Query(); + $latestQuery->ids(new Horde_Imap_Client_Ids($filter["value"])); + $clientSearches[] = $latestQuery; + } + } + if ($filter["property"] === "recent" && $filter["operator"] === "=" && $filter["value"] === true) { + $recentQuery = new Horde_Imap_Client_Search_Query(); + $recentQuery->flag(Horde_Imap_Client::FLAG_RECENT, true); + $clientSearches[] = $recentQuery; + } + } + + $searchQuery->orSearch($clientSearches); + } + + return $searchQuery; + } +} diff --git a/src/Horde_Imap/Client/HordeClient.php b/src/Horde/Mail/Client/Imap/HordeClient.php similarity index 75% rename from src/Horde_Imap/Client/HordeClient.php rename to src/Horde/Mail/Client/Imap/HordeClient.php index 50913d4b..c5e9a808 100644 --- a/src/Horde_Imap/Client/HordeClient.php +++ b/src/Horde/Mail/Client/Imap/HordeClient.php @@ -27,42 +27,40 @@ declare(strict_types=1); -namespace Conjoon\Horde_Imap\Client; - -use Conjoon\Mime\MimeType; -use Conjoon\Data\Sort\SortInfoList; -use Conjoon\Data\Filter\Filter; -use Conjoon\MailClient\Data\CompoundKey\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Exception\MailFolderNotFoundException; -use Conjoon\MailClient\Folder\ListMailFolder; -use Conjoon\MailClient\Folder\MailFolderList; -use Conjoon\MailClient\Data\Protocol\Imap\ImapClientException; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Message\Composer\AttachmentComposer; -use Conjoon\MailClient\Message\Composer\BodyComposer; -use Conjoon\MailClient\Message\Composer\HeaderComposer; -use Conjoon\MailClient\Message\Flag\AnsweredFlag; -use Conjoon\MailClient\Message\Flag\DraftFlag; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; -use Conjoon\MailClient\Data\Resource\Query\MessageItemListQuery; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; +namespace Conjoon\Horde\Mail\Client\Imap; + +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Data\CompoundKey\CompoundKey; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\Folder\ListMailFolder; +use Conjoon\Mail\Client\Folder\MailFolderList; +use Conjoon\Mail\Client\Imap\ImapClientException; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\Message\Composer\AttachmentComposer; +use Conjoon\Mail\Client\Message\Composer\BodyComposer; +use Conjoon\Mail\Client\Message\Composer\HeaderComposer; +use Conjoon\Mail\Client\Message\Flag\AnsweredFlag; +use Conjoon\Mail\Client\Message\Flag\DraftFlag; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; +use Conjoon\Util\ArrayUtil; use DateTime; use Exception; use Horde_Imap_Client; use Horde_Imap_Client_Exception; -use Horde_Imap_Client_Exception_NoSupportExtension; use Horde_Imap_Client_Fetch_Query; use Horde_Imap_Client_Ids; use Horde_Imap_Client_Socket; @@ -77,11 +75,12 @@ * Default implementation of a HordeClient, using \Horde_Imap_Client to communicate with * Imap Mail Servers. * - * @package Conjoon\MailClient\Imap + * @package Conjoon\Mail\Client\Imap */ class HordeClient implements MailClient { use FilterTrait; + use AttributeTrait; use AttachmentTrait; /** @@ -114,47 +113,26 @@ class HordeClient implements MailClient */ protected AttachmentComposer $attachmentComposer; - /** - * @var SortInfoStrategy - */ - protected SortInfoStrategy $sortInfoStrategy; - - /** * HordeClient constructor. * * @param MailAccount $account * @param BodyComposer $bodyComposer * @param HeaderComposer $headerComposer - * @param AttachmentComposer $attachmentComposer - * @param SortInfoStrategy $sortInfoStrategy */ public function __construct( MailAccount $account, BodyComposer $bodyComposer, HeaderComposer $headerComposer, - AttachmentComposer $attachmentComposer, - SortInfoStrategy $sortInfoStrategy + AttachmentComposer $attachmentComposer ) { $this->mailAccount = $account; $this->bodyComposer = $bodyComposer; $this->headerComposer = $headerComposer; $this->attachmentComposer = $attachmentComposer; - $this->sortInfoStrategy = $sortInfoStrategy; - } - - /** - * Returns the SortInfoStrategy this instance was configured with. - * - * @return SortInfoStrategy - */ - public function getSortInfoStrategy(): SortInfoStrategy - { - return $this->sortInfoStrategy; } - /** * Returns the BodyComposer this instance was configured with. * @@ -191,11 +169,11 @@ public function getAttachmentComposer(): AttachmentComposer * Returns the MailAccount providing connection info for the CompoundKey * or string (which will be treated as the id of the MailAccount to look up). * - * @param string|CompoundKey $key + * @param CompoundKey|string $key * * @return MailAccount|null */ - public function getMailAccount(CompoundKey|string $key): ?MailAccount + public function getMailAccount($key): ?MailAccount { $id = $key; @@ -226,7 +204,7 @@ public function getMailAccount(CompoundKey|string $key): ?MailAccount * @throws ImapClientException if the MailAccount used with this Client does not share * the same mailAccountId with the $key */ - public function connect(CompoundKey|string $key): Horde_Imap_Client_Socket + public function connect($key): Horde_Imap_Client_Socket { if (!$this->socket) { @@ -258,9 +236,8 @@ public function connect(CompoundKey|string $key): Horde_Imap_Client_Socket /** * @inheritdoc */ - public function getMailFolderList(MailAccount $mailAccount, MailFolderListQuery $query): MailFolderList + public function getMailFolderList(MailAccount $mailAccount): MailFolderList { - $fields = $query->getFields(); try { $client = $this->connect($mailAccount->getId()); @@ -274,46 +251,22 @@ public function getMailFolderList(MailAccount $mailAccount, MailFolderListQuery $mailFolderList = new MailFolderList(); foreach ($mailboxes as $folderId => $mailbox) { - $args = ["name" => $folderId]; + $status = ["unseen" => 0]; if ($this->isMailboxSelectable($mailbox)) { - foreach ( - [ - "unreadMessages" => Horde_Imap_Client::STATUS_UNSEEN, - "totalMessages" => Horde_Imap_Client::STATUS_MESSAGES - ] as $field => $attribute - ) { - if (in_array($field, $fields)) { - $args[$field] = $attribute; - } - } - - if (count($args) > 1) { - $status = $client->status(...array_values($args)); - - foreach (["unseen" => "unreadMessages", "messages" => "totalMessages"] as $key => $val) { - if (array_key_exists($key, $status)) { - $args[$val] = $status[$key]; - } else { - unset($args[$val]); - } - } - } + $status = $client->status( + $folderId, + Horde_Imap_Client::STATUS_UNSEEN + ); } - $properties = [ + $folderKey = new FolderKey($mailAccount, $folderId); + $mailFolderList[] = new ListMailFolder($folderKey, [ + "name" => $folderId, "delimiter" => $mailbox["delimiter"], + "unreadCount" => $status["unseen"], "attributes" => $mailbox["attributes"] - ]; - - foreach ($args as $field => $attribute) { - $properties = in_array($field, $fields) - ? array_merge($properties, [$field => $attribute]) - : $properties; - } - - $folderKey = new FolderKey($mailAccount, $folderId); - $mailFolderList[] = new ListMailFolder($folderKey, $properties); + ]); } } catch (Exception $e) { throw new ImapClientException($e->getMessage(), 0, $e); @@ -326,38 +279,25 @@ public function getMailFolderList(MailAccount $mailAccount, MailFolderListQuery /** * @inheritdoc */ - public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $query): MessageItemList + public function getMessageItemList(FolderKey $folderKey, MessageItemListResourceQuery $query): MessageItemList { + $options = $query->toJson(); + try { $client = $this->connect($folderKey); - if (!$this->doesMailboxExist($folderKey)) { - throw new MailFolderNotFoundException( - "The mailbox \"{$folderKey->getId()}\" was not found for this account." - ); - } - - $results = $this->queryItems( - $client, - $folderKey, - $query->getSort(), - $query->getFilter() - ); - $fetchedItems = $this->fetchMessageItems( - $client, - $results["match"], - $folderKey->getId(), - $query - ); + $results = $this->queryItems($client, $folderKey, $options); + $fetchedItems = $this->fetchMessageItems($client, $results["match"], $folderKey->getId(), $options); + $options["attributes"] = $options["attributes"] ?? $this->getDefAttr(); return $this->buildMessageItems( $client, $folderKey, $fetchedItems, - $query->getFields() + $options ); - } catch (Horde_Imap_Client_Exception $e) { + } catch (Exception $e) { throw new ImapClientException($e->getMessage(), 0, $e); } } @@ -366,21 +306,14 @@ public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $q /** * @inheritdoc */ - public function getMessageCount(FolderKey $folderKey): array + public function getTotalMessageCount(FolderKey $folderKey): int { try { $client = $this->connect($folderKey); - $status = $client->status( - $folderKey->getId(), - Horde_Imap_Client::STATUS_UNSEEN, - Horde_Imap_Client::STATUS_MESSAGES, - ); + $results = $this->queryItems($client, $folderKey); - return [ - "unreadMessages" => $status["unseen"], - "totalMessages" => $status["messages"] - ]; + return count($results["match"]); } catch (Exception $e) { throw new ImapClientException($e->getMessage(), 0, $e); } @@ -390,18 +323,47 @@ public function getMessageCount(FolderKey $folderKey): array /** * @inheritdoc */ - public function getMessageItem(MessageKey $messageKey, MessageItemQuery $query): ?MessageItem + public function getUnreadMessageCount(FolderKey $folderKey): int { - return $this->getItemOrDraft($messageKey, $query, true); + + try { + $client = $this->connect($folderKey); + $status = $client->status($folderKey->getId(), Horde_Imap_Client::STATUS_UNSEEN); + + return $status["unseen"]; + } catch (Exception $e) { + throw new ImapClientException($e->getMessage(), 0, $e); + } } /** * @inheritdoc */ - public function getMessageItemDraft(MessageKey $messageKey, MessageItemQuery $query): ?MessageItemDraft + public function getMessageItem(MessageKey $messageKey): ?MessageItem { - return $this->getItemOrDraft($messageKey, $query, false); + + try { + $client = $this->connect($messageKey); + $mailFolderId = $messageKey->getMailFolderId(); + $fetchedItems = $this->fetchMessageItems( + $client, + new Horde_Imap_Client_Ids($messageKey->getId()), + $mailFolderId, + [] + ); + + $ret = $this->buildMessageItem( + $client, + new FolderKey($messageKey->getMailAccountId(), $mailFolderId), + $fetchedItems[0], + ["attributes" => $this->getDefAttr(["hasAttachments" => true, "size" => true])] + ); + + return new MessageItem($ret["messageKey"], array_filter($ret["data"], fn ($item) => $item !== null)); + } catch (Exception $e) { + throw new ImapClientException($e->getMessage(), 0, $e); + } } @@ -433,6 +395,38 @@ public function deleteMessage(MessageKey $messageKey): bool } + /** + * @inheritdoc + */ + public function getMessageItemDraft(MessageKey $messageKey): ?MessageItemDraft + { + + try { + $client = $this->connect($messageKey); + $mailFolderId = $messageKey->getMailFolderId(); + $fetchedItems = $this->fetchMessageItems( + $client, + new Horde_Imap_Client_Ids($messageKey->getId()), + $mailFolderId, + [] + ); + $ret = $this->buildMessageItem( + $client, + new FolderKey($messageKey->getMailAccountId(), $mailFolderId), + $fetchedItems[0], + ["attributes" => $this->getDefAttr(["cc" => true, "bcc" => true, "replyTo" => true])] + ); + + return new MessageItemDraft( + $ret["messageKey"], + array_filter($ret["data"], fn ($item) => $item !== null) + ); + } catch (Exception $e) { + throw new ImapClientException($e->getMessage(), 0, $e); + } + } + + /** * @inheritdoc */ @@ -460,17 +454,17 @@ public function getMessageBody(MessageKey $messageKey): MessageBody $messageStructure = $serverItem->getStructure(); $d = $this->getContents($client, $messageStructure, $messageKey, [ - "plain", "html" + "attributes" => ["plain" => true, "html" => true] ]); $body = new MessageBody($messageKey); if ($d["html"]["content"]) { - $htmlPart = new MessagePart($d["html"]["content"], $d["html"]["charset"], MimeType::TEXT_HTML); + $htmlPart = new MessagePart($d["html"]["content"], $d["html"]["charset"], "text/html"); $body->setTextHtml($htmlPart); } - $plainPart = new MessagePart($d["plain"]["content"], $d["plain"]["charset"], MimeType::TEXT_PLAIN); + $plainPart = new MessagePart($d["plain"]["content"], $d["plain"]["charset"], "text/plain"); $body->setTextPlain($plainPart); } catch (Exception $e) { throw new ImapClientException($e->getMessage(), 0, $e); @@ -517,46 +511,6 @@ public function setFlags(MessageKey $messageKey, FlagList $flagList): bool } - /** - * @inheritdoc - */ - public function createMessageDraft(FolderKey $folderKey, MessageItemDraft $messageItemDraft): MessageItemDraft - { - - if ($messageItemDraft->getMessageKey()) { - throw new ImapClientException( - "Cannot create a MessageItemDraft that already has a MessageKey" - ); - } - - try { - $client = $this->connect($folderKey); - - if (!$this->doesMailboxExist($folderKey)) { - throw new MailFolderNotFoundException( - "The mailbox \"{$folderKey->getId()}\" was not found for this account." - ); - } - - $fullText = $this->getHeaderComposer()->compose("", $messageItemDraft); - - $ids = $client->append($folderKey->getId(), [[ - "data" => $fullText, - "flags" => $messageItemDraft->getFlagList()->resolveToFlags() - ]]); - - $newKey = new MessageKey( - $folderKey, - (string)$ids->ids[0] - ); - - return $messageItemDraft->setMessageKey($newKey); - } catch (Horde_Imap_Client_Exception $e) { - throw new ImapClientException($e->getMessage(), 0, $e); - } - } - - /** * @inheritdoc */ @@ -697,8 +651,8 @@ public function sendMessageDraft(MessageKey $messageKey): bool $headers = Horde_Mime_Headers::parseHeaders($target); // Check for X-CN-DRAFT-INFO... - $draftInfo = $headers->getHeader("X-CN-DRAFT-INFO"); - $draftInfo = $draftInfo?->value_single; + $xCnDraftInfo = $headers->getHeader("X-CN-DRAFT-INFO"); + $xCnDraftInfo = $xCnDraftInfo ? $xCnDraftInfo->value_single : null; // ...delete the header... $headers->removeHeader("X-CN-DRAFT-INFO"); @@ -710,8 +664,8 @@ public function sendMessageDraft(MessageKey $messageKey): bool $mail->send($mailer); // ...and set \Answered flag. - if ($draftInfo) { - $this->setAnsweredForDraftInfo($draftInfo, $account->getId()); + if ($xCnDraftInfo) { + $this->setAnsweredForDraftInfo($xCnDraftInfo, $account->getId()); } return true; @@ -770,69 +724,26 @@ public function moveMessage(MessageKey $messageKey, FolderKey $folderKey): Messa } } - // ------------------- - // Helper - // ------------------- +// ------------------- +// Helper +// ------------------- /** - * Returns a MessageItem or a MessageItemDraft, based on $returnItem. - * @param MessageKey $messageKey - * @param MessageItemQuery $query - * @param bool $returnItem - * - * @return MessageItem|MessageItemDraft - * - * @throws ImapClientException - */ - protected function getItemOrDraft( - MessageKey $messageKey, - MessageItemQuery $query, - bool $returnItem = true - ): MessageItem|MessageItemDraft { - try { - $client = $this->connect($messageKey); - $mailFolderId = $messageKey->getMailFolderId(); - $fetchedItems = $this->fetchMessageItems( - $client, - new Horde_Imap_Client_Ids($messageKey->getId()), - $mailFolderId, - $query - ); - - $ret = $this->buildMessageItem( - $client, - new FolderKey($messageKey->getMailAccountId(), $mailFolderId), - $fetchedItems[0], - $query->getFields() - ); - - $class = $returnItem === false ? MessageItemDraft::class : MessageItem::class; - return new $class( - $ret["messageKey"], - array_filter($ret["data"], fn ($item) => $item !== null) - ); - } catch (Exception $e) { - throw new ImapClientException($e->getMessage(), 0, $e); - } - } - - - /** - * Sets the flag \Answered for the message specified in $draftInfo. + * Sets the flag \Answered for the message specified in $xCnDraftInfo. * The string is expected to be a base64-encoded string representing * a JSON-encoded array with three indices: mailAccountId, mailFolderId * and id. - * Will do nothing if the mailAccountId in $draftInfo does not match + * Will do nothing if the mailAccountId in $xCnDraftInfo does not match * the $forAccountId passed to this method, or if decoding the $xCnDraftInfo * failed. * - * @param string $draftInfo + * @param string $xCnDraftInfo * @param string $forAccountId */ - protected function setAnsweredForDraftInfo(string $draftInfo, string $forAccountId) + protected function setAnsweredForDraftInfo(string $xCnDraftInfo, string $forAccountId) { - $baseDecode = base64_decode($draftInfo); + $baseDecode = base64_decode($xCnDraftInfo); if ($baseDecode === false) { return; @@ -863,9 +774,9 @@ protected function setAnsweredForDraftInfo(string $draftInfo, string $forAccount * * @param MailAccount $account * - * @return Horde_Mail_Transport_Smtphorde|Horde_Mail_Transport|null + * @return Horde_Mail_Transport */ - public function getMailer(MailAccount $account): Horde_Mail_Transport_Smtphorde|Horde_Mail_Transport|null + public function getMailer(MailAccount $account) { $account = $this->getMailAccount($account->getId()); @@ -943,27 +854,21 @@ protected function appendAsDraft( * @param Horde_Imap_Client_Socket $client * @param Horde_Imap_Client_Ids $searchResultIds * @param string $mailFolderId - * @param MessageItemQuery|MessageItemListQuery $query + * @param array $options * * @return array * * @throws Horde_Imap_Client_Exception - * @throws Horde_Imap_Client_Exception_NoSupportExtension */ protected function fetchMessageItems( Horde_Imap_Client_Socket $client, Horde_Imap_Client_Ids $searchResultIds, string $mailFolderId, - MessageItemQuery|MessageItemListQuery $query + array $options ): array { - $start = -1; - $limit = -1; - - if ($query instanceof MessageItemListQuery) { - $start = $query->getStart() ?? -1; - $limit = $query->getLimit() ?? -1; - } + $start = isset($options["start"]) ? intval($options["start"]) : -1; + $limit = isset($options["limit"]) ? intval($options["limit"]) : -1; if ($start >= 0 && $limit > 0) { $rangeList = new Horde_Imap_Client_Ids(); @@ -1005,10 +910,12 @@ protected function fetchMessageItems( * @param Horde_Imap_Client_Socket $client * @param FolderKey $key * @param $item - * @param array $fields An array with that specifies the fields to query. + * @param array $options An array with a key "attributes" that specifies the attributes to query. + * The keys are the attributes that should be considered, the values are configuration options for the queries + * of the fields. * * @example - * $this->buildMessageItem($client, $key, $item, ["size", "hasAttachments"]); + * $this->buildMessageItem($client, $key, $item, ["attributes" => ["size" => [], "hasAttachments" => true]]); * * * @return array an array indexed with "messageKey" and "data" which should both be used to create @@ -1021,10 +928,10 @@ protected function buildMessageItem( Horde_Imap_Client_Socket $client, FolderKey $key, $item, - array $fields + array $options = [] ): array { - $result = $this->getItemStructure($client, $item, $key, $fields); + $result = $this->getItemStructure($client, $item, $key, $options); return [ "messageKey" => $result["messageKey"], @@ -1035,11 +942,13 @@ protected function buildMessageItem( /** * Transform the passed list of $items to an instance of MessageItemList. + * If both html/plain attributes where requested, it will always try to use + * text/plain for the MessagePart, then fall back to text/html if required. * * @param Horde_Imap_Client_Socket $client * @param FolderKey $key * @param array $items - * @param array $fields array of field names that should be considered + * @param array $options * * @return MessageItemList * @@ -1050,20 +959,53 @@ protected function buildMessageItems( Horde_Imap_Client_Socket $client, FolderKey $key, array $items, - array $fields + array $options ): MessageItemList { $messageItems = new MessageItemList(); + $attributes = $options["attributes"] ?? []; + foreach ($items as $item) { - $result = $this->getItemStructure($client, $item, $key, $fields); + $result = $this->getItemStructure($client, $item, $key, $options); $data = $result["data"]; + $contentData = $result["contentData"]; + + $messageItem = null; + $messagePart = null; + + $contentKeys = []; + $this->getAttr("plain", $attributes) && $contentKeys[] = "plain"; + $this->getAttr("html", $attributes) && $contentKeys[] = "html"; + + // if precedence is set for html, reverse this. Else, let plain + // process first + if (ArrayUtil::unchain("html.precedence", $attributes, false) === true) { + $contentKeys = array_reverse($contentKeys); + } + + // plain first + foreach ($contentKeys as $contentKey) { + $content = $contentData[$contentKey] ?? null; + if (!$content || !trim($content["content"])) { + continue; + } + $messagePart = new MessagePart( + $content['content'], + $content['charset'], + $contentKey === "plain" ? "text/plain" : "text/html" + ); + // if we have a MessagePart for the preview, we can exit + break; + } + $messageKey = $result["messageKey"]; - $messageItem = new MessageItem( + $messageItem = new ListMessageItem( $messageKey, - $data + $data, + $messagePart ); $messageItems[] = $messageItem; @@ -1080,16 +1022,18 @@ protected function buildMessageItems( * @param Horde_Imap_Client_Socket $client * @param $item * @param FolderKey $key - * @param array $fields An array providing "fields" which is numeric array holding - * fields to return + * @param array $options An array providing "attributes" which is an associative array where the keys + * are the attributes that should be queried, and their values additional configuration options for the + * query itself. * * @example * $this->getItemStructure( * $client, * $item, * $key, - * ["from", "to", "plain"] - * ); // returns "from", "to" and "plain" + * ["attributes" => [ + * "from" => [], "to" => true, "plain" => ["length" => 200] + * ]]); // returns "from", "to" and "plain" with a length of 100 characters * * * @return array data with the item structure, options holding additional requested data (passed via $options) @@ -1101,11 +1045,11 @@ protected function getItemStructure( Horde_Imap_Client_Socket $client, $item, FolderKey $key, - array $fields = [] + array $options = [] ): array { - $wants = function ($key) use ($fields) { - return in_array($key, $fields); + $wants = function ($key) use ($options) { + return $this->getAttr($key, $options["attributes"] ?? []); }; $envelope = $item->getEnvelope(); @@ -1134,8 +1078,6 @@ protected function getItemStructure( $wants("messageId") && $data["messageId"] = $envelope->message_id; $wants("size") && $data["size"] = $item->getSize(); - $wants("draftInfo") && $data["draftInfo"] = $item->getHeaders("X-CN-DRAFT-INFO"); - ($wants("charset") || $wants("subject")) && $data["charset"] = $this->getCharsetFromContentTypeHeaderValue( $item->getHeaders("ContentType") @@ -1146,9 +1088,9 @@ protected function getItemStructure( $contentData = []; - if ($wants("hasAttachments")) { + if ($wants("hasAttachments") || $wants("plain") || $wants("html")) { $messageStructure = $item->getStructure(); - $contentData = $this->getContents($client, $messageStructure, $messageKey, $fields); + $contentData = $this->getContents($client, $messageStructure, $messageKey, $options); if ($wants("hasAttachments") && array_key_exists("hasAttachments", $contentData)) { $data["hasAttachments"] = $contentData["hasAttachments"]; @@ -1169,27 +1111,59 @@ protected function getItemStructure( * * @param Horde_Imap_Client_Socket $client * @param FolderKey $key The key of the folder to query - * @param SortInfoList|null $sortInfo - * @param Filter|null $filter + * @param array|null $options An array with the following options + * - start (integer) The start position from where to return the results + * - limit (integer) The number of items to return. + * - filter (array) an array of filters to consider. Any ids to look up must be included in the filter. + * A filter is assembled using "property" (field-name), "operator" and "value" (value to look up). For + * filtering for multiple ids, use a filter in the form of + * (["property" => "id", "operator" => "in", "value" => ["1", "2", "3"]]) + * - attributes (array) an assoc array of attributes that should be queried. Ignored by this method. + * + * @example + * $this->queryItems($client, $key, [ + * "sort" => [["property" => "date", "direction" => "DESC"]] + * ]); * - * @return array * + * @return array * @throws Horde_Imap_Client_Exception */ - protected function queryItems( - Horde_Imap_Client_Socket $client, - FolderKey $key, - ?SortInfoList $sortInfo, - ?Filter $filter - ): array { + protected function queryItems(Horde_Imap_Client_Socket $client, FolderKey $key, array $options = null): array + { + $searchOptions = []; + if ($options !== null) { + $sort = $options["sort"] ?? [["property" => "date", "direction" => "DESC"]]; + $sort = $sort[0]; - $searchOptions = [ - "sort" => $sortInfo - ? $sortInfo->toJson($this->sortInfoStrategy) - : [Horde_Imap_Client::SORT_REVERSE, Horde_Imap_Client::SORT_DATE] - ]; + $sortInfo = []; + + if ($sort["direction"] === "DESC") { + $sortInfo[] = Horde_Imap_Client::SORT_REVERSE; + } + + switch ($sort["property"]) { + case 'subject': + $sortInfo[] = Horde_Imap_Client::SORT_SUBJECT; + break; + case 'to': + $sortInfo[] = Horde_Imap_Client::SORT_TO; + break; + case 'from': + $sortInfo[] = Horde_Imap_Client::SORT_FROM; + break; + case 'date': + $sortInfo[] = Horde_Imap_Client::SORT_DATE; + break; + case 'size': + $sortInfo[] = Horde_Imap_Client::SORT_SIZE; + break; + } + + $searchOptions = ["sort" => $sortInfo]; + } - $searchQuery = $filter ? $this->getSearchQueryFromFilter($filter) : null; + $searchQuery = $this->getSearchQueryFromFilter($options["filter"] ?? []); // search and narrow down list return $client->search($key->getId(), $searchQuery, $searchOptions); @@ -1198,20 +1172,24 @@ protected function queryItems( /** * Returns contents of the mail. Possible return keys are based on the passed - * $options "fields": "html" (string), "plain" (string) and/or "hasAttachments" (bool) + * $options "attributes": "html" (string), "plain" (string) and/or "hasAttachments" (bool) * * @param Horde_Imap_Client_Socket $client * @param $messageStructure * @param MessageKey $key - * @param array $fields an array of fields this method should consider. Possible - * keys are html, plain, hasAttachments. The values are configuration - * objects this method should considered. - * + * @param array $options = array ( + * "attributes" => [] // an array of attributes this method should consider. Possible + * // keys are html, plain, hasAttachments. The values are configuration + * // objects this method should considered. + * // Both "html" and "plain" allow for specifying a "length"-option + * // that tells this method to only return the specified number + * // of characters for this message part. + * ); * * @example * $this->getContents($client, $messageStructure, $key, [ - * "html", "plain" - * ]); // returns full html + * "attributes" => ["html" => [], "plain" => [$length => 200]] + * ]); // returns full html, but only first 200 characters of plain. * * * @return array @@ -1222,13 +1200,15 @@ protected function getContents( Horde_Imap_Client_Socket $client, $messageStructure, MessageKey $key, - array $fields = [] + array $options ): array { + $attributes = $options["attributes"] ?? []; + $ret = []; - $findHtml = in_array("html", $fields); - $findPlain = in_array("plain", $fields); - $findAttachments = in_array("hasAttachments", $fields); + $findHtml = $this->getAttr("html", $attributes); + $findPlain = $this->getAttr("plain", $attributes); + $findAttachments = $this->getAttr("hasAttachments", $attributes); $typeMap = $messageStructure->contentTypeMap(); $bodyQuery = new Horde_Imap_Client_Fetch_Query(); @@ -1338,7 +1318,7 @@ protected function getTextContent($type, $messageStructure, $messageData, $typeM protected function getMessageIdStringFromReferencesHeaderValue(string $value): string { - if (!str_starts_with($value, "References:")) { + if (strpos($value, "References:") !== 0) { return ""; } @@ -1390,7 +1370,7 @@ protected function isMailboxSelectable(array $mailbox): bool * * @return MailAddress|MailAddressList|null */ - protected function getAddress($envelope, string $type): MailAddressList|MailAddress|null + protected function getAddress($envelope, string $type) { $type = $type === "replyTo" ? "reply-to" : $type; @@ -1429,12 +1409,8 @@ protected function getAddress($envelope, string $type): MailAddressList|MailAddr /** * @param MessageKey $messageKey - * @param Horde_Imap_Client_Socket $client - * @return mixed - * @throws Horde_Imap_Client_Exception - * @throws Horde_Imap_Client_Exception_NoSupportExtension */ - protected function getFullMsg(MessageKey $messageKey, Horde_Imap_Client_Socket $client): mixed + protected function getFullMsg(MessageKey $messageKey, Horde_Imap_Client_Socket $client) { $mailFolderId = $messageKey->getMailFolderId(); $id = $messageKey->getId(); @@ -1448,31 +1424,4 @@ protected function getFullMsg(MessageKey $messageKey, Horde_Imap_Client_Socket $ return $fetchResult[$id]->getFullMsg(false); } - - - /** - * Return true if the mailbox represented by $folderKey exists on the server, otehrwise false. - * - * @param FolderKey $folderKey - * @return bool - * @throws Horde_Imap_Client_Exception - */ - protected function doesMailboxExist(FolderKey $folderKey): bool - { - $client = $this->connect($folderKey); - - $mailboxes = $client->listMailboxes( - $folderKey->getId(), - Horde_Imap_Client::MBOX_ALL - ); - - - $key = array_keys($mailboxes)[0] ?? null; - - if (!$key) { - return false; - } - - return strtolower($key) === strtolower($folderKey->getId()); - } } diff --git a/src/Horde_Mime/Composer/HordeAttachmentComposer.php b/src/Horde/Mail/Client/Message/Composer/HordeAttachmentComposer.php similarity index 91% rename from src/Horde_Mime/Composer/HordeAttachmentComposer.php rename to src/Horde/Mail/Client/Message/Composer/HordeAttachmentComposer.php index a0adb1b4..110ec2b3 100644 --- a/src/Horde_Mime/Composer/HordeAttachmentComposer.php +++ b/src/Horde/Mail/Client/Message/Composer/HordeAttachmentComposer.php @@ -27,10 +27,10 @@ declare(strict_types=1); -namespace Conjoon\Horde_Mime\Composer; +namespace Conjoon\Horde\Mail\Client\Message\Composer; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Message\Composer\AttachmentComposer; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Message\Composer\AttachmentComposer; use Horde_Mime_Exception; use Horde_Mime_Headers; use Horde_Mime_Part; @@ -38,7 +38,7 @@ /** * Class HordeBodyComposer * - * @package Conjoon\Horde_Mime\Composer + * @package Conjoon\Horde\Mail\Client\Message\Composer */ class HordeAttachmentComposer implements AttachmentComposer { diff --git a/src/Horde_Mime/Composer/HordeBodyComposer.php b/src/Horde/Mail/Client/Message/Composer/HordeBodyComposer.php similarity index 92% rename from src/Horde_Mime/Composer/HordeBodyComposer.php rename to src/Horde/Mail/Client/Message/Composer/HordeBodyComposer.php index 14417395..4ae65a53 100644 --- a/src/Horde_Mime/Composer/HordeBodyComposer.php +++ b/src/Horde/Mail/Client/Message/Composer/HordeBodyComposer.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Conjoon\Horde_Mime\Composer; +namespace Conjoon\Horde\Mail\Client\Message\Composer; -use Conjoon\MailClient\Message\Composer\BodyComposer; -use Conjoon\MailClient\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\Composer\BodyComposer; +use Conjoon\Mail\Client\Message\MessageBodyDraft; use Horde_Mime_Headers; use Horde_Mime_Part; /** * Class HordeBodyComposer * - * @package Conjoon\Horde_Mime\Composer + * @package Conjoon\Horde\Mail\Client\Message\Composer */ class HordeBodyComposer implements BodyComposer { diff --git a/src/Horde_Mime/Composer/HordeHeaderComposer.php b/src/Horde/Mail/Client/Message/Composer/HordeHeaderComposer.php similarity index 93% rename from src/Horde_Mime/Composer/HordeHeaderComposer.php rename to src/Horde/Mail/Client/Message/Composer/HordeHeaderComposer.php index fff938a5..c231cfb9 100644 --- a/src/Horde_Mime/Composer/HordeHeaderComposer.php +++ b/src/Horde/Mail/Client/Message/Composer/HordeHeaderComposer.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Conjoon\Horde_Mime\Composer; +namespace Conjoon\Horde\Mail\Client\Message\Composer; -use Conjoon\MailClient\Message\Composer\HeaderComposer; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\Core\Contract\Stringable; +use Conjoon\Mail\Client\Message\Composer\HeaderComposer; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Util\Stringable; use DateTime; use Horde_Mime_Exception; use Horde_Mime_Headers; @@ -41,7 +41,7 @@ /** * Class HordeHeaderComposer * - * @package Conjoon\Horde_Mime\Composer + * @package Conjoon\Horde\Mail\Client\Message\Composer */ class HordeHeaderComposer implements HeaderComposer { @@ -56,7 +56,7 @@ public function compose(string $target, MessageItemDraft $source = null): string $headers = Horde_Mime_Headers::parseHeaders($target); $normalizedHeaders = [ - "draftInfo" => "X-Cn-Draft-Info", + "xCnDraftInfo" => "X-Cn-Draft-Info", "replyTo" => "Reply-To", "inReplyTo" => "In-Reply-To", "userAgent" => "User-Agent", @@ -132,9 +132,9 @@ public function compose(string $target, MessageItemDraft $source = null): string // if our X-CN-DRAFT-INFO header field is not set, we will set it here if ( $source && (!$headers->getHeader("X-Cn-Draft-Info") && - $source->getDraftInfo()) + $source->getXCnDraftInfo()) ) { - $headerData["draftInfo"] = $source->getDraftInfo(); + $headerData["xCnDraftInfo"] = $source->getXCnDraftInfo(); } // if we do not have a Message Id, we will generate one here and @@ -188,7 +188,7 @@ public function compose(string $target, MessageItemDraft $source = null): string * - messageId * - references * - userAgent - * - draftInfo + * - xCnDraftInfo * * Additional header fields specified in $fields not matching order-fields * will be appended in no particular order to the returned array. @@ -213,7 +213,7 @@ public function sortHeaderFields(array $fields): array "inReplyTo", "references", "userAgent", - "draftInfo" + "xCnDraftInfo" ]; $intersect = array_intersect($order, $fields); diff --git a/src/Horde_Imap/Client/FilterTrait.php b/src/Horde_Imap/Client/FilterTrait.php deleted file mode 100644 index 76b5e90a..00000000 --- a/src/Horde_Imap/Client/FilterTrait.php +++ /dev/null @@ -1,133 +0,0 @@ -getSearchQueryFromFilterTrait($filter)->__toString(); // "OR (UID 1000:*) (RECENT)" - * - * Trait FilterTrait - * @package Conjoon\Horde_Imap\Client - */ -trait FilterTrait -{ - /** - * Looks up filter information from the passed Filter and creates a - * Horde_Imap_Client_Search_Query from it. - * - * @param Filter $filter - * - * @return Horde_Imap_Client_Search_Query - */ - public function getSearchQueryFromFilter(Filter $filter): Horde_Imap_Client_Search_Query - { - $searchQuery = new Horde_Imap_Client_Search_Query(); - - $clientSearches = $this->transformFilter($filter->getExpression()); - $searchQuery->orSearch($clientSearches); - - return $searchQuery; - } - - - /** - * Transforms the submitted expression into an array of Horde_Imap_Client_Search_Query - * - * @param Expression $filter - * - * @return array - */ - protected function transformFilter(Expression $filter): array - { - $clientSearches = []; - - $operator = $filter->getOperator()->toString(); - $operands = $filter->getOperands(); - - if ($operator === LogicalOperator::OR->value) { - foreach ($operands as $operand) { - $clientSearches = array_merge($clientSearches, $this->transformFilter($operand)); - } - } elseif ($operator === LogicalOperator::AND->value) { - throw new \RuntimeException("AND not supported"); - } - - $property = strtoupper($filter->getOperands()[0]->toString()); - $value = $filter->getOperands()[1]; - - if (in_array($property, ["ID", "UID"])) { - $property = "UID"; - if ($operator === ">=") { - $value = array_slice($filter->getOperands()->toArray(), 1); - $filterId = implode(":", $value) . ":*"; - $latestQuery = new Horde_Imap_Client_Search_Query(); - $latestQuery->ids(new Horde_Imap_Client_Ids([$filterId])); - $clientSearches[] = $latestQuery; - } elseif ($operator === "IN") { - $value = array_slice($filter->getOperands()->toArray(), 1); - $latestQuery = new Horde_Imap_Client_Search_Query(); - $latestQuery->ids(new Horde_Imap_Client_Ids($value)); - $clientSearches[] = $latestQuery; - } - } - if ($property === "RECENT" && $operator === RelationalOperator::EQ->value && $value->getValue() === true) { - $recentQuery = new Horde_Imap_Client_Search_Query(); - $recentQuery->flag(Horde_Imap_Client::FLAG_RECENT, true); - $clientSearches[] = $recentQuery; - } - - return $clientSearches; - } -} diff --git a/src/Horde_Imap/Client/SortInfoStrategy.php b/src/Horde_Imap/Client/SortInfoStrategy.php deleted file mode 100644 index f3eb32fc..00000000 --- a/src/Horde_Imap/Client/SortInfoStrategy.php +++ /dev/null @@ -1,102 +0,0 @@ -toJson($sortInfoList); - * // produces - * // [ - * // Horde_Imap_Client::SORT_REVERSE, - * // Horde_Imap_Client::SORT_SUBJECT, - * // Horde_Imap_Client::SORT_DATE, - * // Horde_Imap_Client::SORT_REVERSE, - * // Horde_Imap_Client::SORT_SIZE - * // ] - * - */ -class SortInfoStrategy implements JsonStrategy -{ - /** - * @inheritdoc - */ - public function toJson(Arrayable $source): array - { - $data = []; - if ($source instanceof SortInfoList) { - foreach ($source as $sortInfo) { - $data = array_merge($data, $sortInfo->toJson($this)); - } - } - - if ($source instanceof SortInfo) { - if ($source->getDirection() === SortDirection::DESC) { - $data[] = Horde_Imap_Client::SORT_REVERSE; - } - - switch ($source->getField()) { - case "subject": - $data[] = Horde_Imap_Client::SORT_SUBJECT; - break; - case "to": - $data[] = Horde_Imap_Client::SORT_TO; - break; - case "from": - $data[] = Horde_Imap_Client::SORT_FROM; - break; - case "date": - $data[] = Horde_Imap_Client::SORT_DATE; - break; - case "size": - $data[] = Horde_Imap_Client::SORT_SIZE; - break; - } - } - - return $data; - } -} diff --git a/src/Http/Exception/BadRequestException.php b/src/Http/Exception/BadRequestException.php index 7c91acd6..300d508c 100644 --- a/src/Http/Exception/BadRequestException.php +++ b/src/Http/Exception/BadRequestException.php @@ -29,7 +29,7 @@ namespace Conjoon\Http\Exception; -use Conjoon\Http\StatusCodes; +use Conjoon\Http\Status\StatusCodes; /** * Class BadRequestException @@ -37,8 +37,5 @@ */ class BadRequestException extends HttpException { - /** - * @var int - */ protected $code = StatusCodes::HTTP_400; } diff --git a/src/Http/Exception/ForbiddenException.php b/src/Http/Exception/ForbiddenException.php deleted file mode 100644 index a609358d..00000000 --- a/src/Http/Exception/ForbiddenException.php +++ /dev/null @@ -1,44 +0,0 @@ - $this->status, @@ -179,56 +157,6 @@ public function toArray(): array "type" => $this->type ]; - if ($this->getAdditionalDetails()) { - if ($this->additionalDetailsKey !== null) { - $data = array_merge($data, [ - $this->additionalDetailsKey => $this->getAdditionalDetails()->toJson() - ]); - } else { - $data = array_merge($data, $this->getAdditionalDetails()->toJson()); - } - } - return array_filter($data, fn ($v) => !empty($v)); } - - - /** - * Sets additional details for this Problem. - * - * @param ParameterBag $bag - * @param string|false|null $key If set to a string, the additionalData will be made available - * under this key in the array resulting with toArray(). If null, the keys available with the - * ParameterBag will be directly merged into the resulting array. - * - * @return void - */ - public function setAdditionalDetails(ParameterBag $bag, string|false|null $key = false): void - { - $this->additionalDetails = $bag; - - if ($key !== false) { - $this->additionalDetailsKey = $key; - } - } - - - /** - * Returns the additional details for this Problem. - * - * @return ParameterBag|null - */ - public function getAdditionalDetails(): ?ParameterBag - { - return $this->additionalDetails; - } - - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - return $strategy ? $strategy->toJson($this) : $this->toArray(); - } } diff --git a/src/JsonProblem/BadRequestProblem.php b/src/Http/Json/Problem/BadRequestProblem.php similarity index 94% rename from src/JsonProblem/BadRequestProblem.php rename to src/Http/Json/Problem/BadRequestProblem.php index a443de16..1c4b2dc3 100644 --- a/src/JsonProblem/BadRequestProblem.php +++ b/src/Http/Json/Problem/BadRequestProblem.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\JsonProblem; +namespace Conjoon\Http\Json\Problem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Status\StatusCodes as Status; /** * Class BadRequestProblem diff --git a/src/JsonProblem/InternalServerErrorProblem.php b/src/Http/Json/Problem/InternalServerErrorProblem.php similarity index 94% rename from src/JsonProblem/InternalServerErrorProblem.php rename to src/Http/Json/Problem/InternalServerErrorProblem.php index 1d98452e..890b67b1 100644 --- a/src/JsonProblem/InternalServerErrorProblem.php +++ b/src/Http/Json/Problem/InternalServerErrorProblem.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\JsonProblem; +namespace Conjoon\Http\Json\Problem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Status\StatusCodes as Status; /** * Class InternalServerErrorProblem diff --git a/src/JsonProblem/MethodNotAllowedProblem.php b/src/Http/Json/Problem/MethodNotAllowedProblem.php similarity index 94% rename from src/JsonProblem/MethodNotAllowedProblem.php rename to src/Http/Json/Problem/MethodNotAllowedProblem.php index 76a6c6c9..d7330a61 100644 --- a/src/JsonProblem/MethodNotAllowedProblem.php +++ b/src/Http/Json/Problem/MethodNotAllowedProblem.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\JsonProblem; +namespace Conjoon\Http\Json\Problem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Status\StatusCodes as Status; /** * Class MethodNotAllowedProblem diff --git a/src/JsonProblem/Problem.php b/src/Http/Json/Problem/Problem.php similarity index 98% rename from src/JsonProblem/Problem.php rename to src/Http/Json/Problem/Problem.php index 10f0db36..4ac67248 100644 --- a/src/JsonProblem/Problem.php +++ b/src/Http/Json/Problem/Problem.php @@ -27,7 +27,7 @@ declare(strict_types=1); -namespace Conjoon\JsonProblem; +namespace Conjoon\Http\Json\Problem; /** * Generic Problem representative. diff --git a/src/JsonProblem/ProblemFactory.php b/src/Http/Json/Problem/ProblemFactory.php similarity index 79% rename from src/JsonProblem/ProblemFactory.php rename to src/Http/Json/Problem/ProblemFactory.php index 5e21e57a..5c8e94d1 100644 --- a/src/JsonProblem/ProblemFactory.php +++ b/src/Http/Json/Problem/ProblemFactory.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\JsonProblem; +namespace Conjoon\Http\Json\Problem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Status\StatusCodes as Status; /** * Class ProblemFactory @@ -37,6 +37,26 @@ */ class ProblemFactory { + /** + * Returns an array containing of the json representative for the made Problem, + * and the second index is the status used. + * + * @param int $status + * @param string|null $title + * @param string|null $detail + * @return array + */ + public static function makeJson(int $status, string $title = null, string $detail = null): array + { + $made = self::make($status, $title, $detail); + + return [ + $made->toJson(), + $made->getStatus() + ]; + } + + /** * Returns a new Problem based on the status submitted. * The concrete representative for the status gets configured with title and detail, @@ -57,15 +77,6 @@ public static function make(int $status, string $title = null, string $detail = case Status::HTTP_400: return new BadRequestProblem($title, $detail); - case Status::HTTP_401: - return new UnauthorizedProblem($title, $detail); - - case Status::HTTP_403: - return new ForbiddenProblem($title, $detail); - - case Status::HTTP_404: - return new NotFoundProblem($title, $detail); - case Status::HTTP_405: return new MethodNotAllowedProblem($title, $detail); diff --git a/src/JsonProblem/README.md b/src/Http/Json/Problem/README.md similarity index 77% rename from src/JsonProblem/README.md rename to src/Http/Json/Problem/README.md index eb2c4c33..fd7dc1f8 100644 --- a/src/JsonProblem/README.md +++ b/src/Http/Json/Problem/README.md @@ -1,3 +1,3 @@ -### Conjoon\JsonProblem +### Conjoon\Http\Api\Problem This package provides representatives for [rfc7807](https://datatracker.ietf.org/doc/html/rfc7807) diff --git a/src/Mime/MimeType.php b/src/Http/Query/InvalidParameterResourceException.php similarity index 79% rename from src/Mime/MimeType.php rename to src/Http/Query/InvalidParameterResourceException.php index 383ac1c0..97c71546 100644 --- a/src/Mime/MimeType.php +++ b/src/Http/Query/InvalidParameterResourceException.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2019-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,16 +27,14 @@ declare(strict_types=1); -namespace Conjoon\Mime; +namespace Conjoon\Http\Query; + +use Conjoon\Http\Exception\InternalServerErrorException; /** - * Represents mime types. + * Class InvalidQueryParameterException + * @package Conjoon\Http\Query */ -enum MimeType: string +class InvalidParameterResourceException extends InternalServerErrorException { - case TEXT_HTML = "text/html"; - - case TEXT_PLAIN = "text/plain"; - - case IMAGE_JPEG = "image/jpeg"; } diff --git a/src/Web/Validation/Exception/InvalidQueryException.php b/src/Http/Query/InvalidQueryException.php similarity index 79% rename from src/Web/Validation/Exception/InvalidQueryException.php rename to src/Http/Query/InvalidQueryException.php index a6105739..9449cc5b 100644 --- a/src/Web/Validation/Exception/InvalidQueryException.php +++ b/src/Http/Query/InvalidQueryException.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,12 +27,14 @@ declare(strict_types=1); -namespace Conjoon\Web\Validation\Exception; +namespace Conjoon\Http\Query; + +use Conjoon\Http\Exception\BadRequestException; /** - * Exception to be thrown when the general state of a query is invalid, e.g. due to - * wrong and/or missing parameters. + * Class InvalidQueryException + * @package Conjoon\Http\Query */ -class InvalidQueryException extends QueryException +class InvalidQueryException extends BadRequestException { } diff --git a/src/Web/Validation/Exception/InvalidQueryParameterException.php b/src/Http/Query/InvalidQueryParameterException.php similarity index 79% rename from src/Web/Validation/Exception/InvalidQueryParameterException.php rename to src/Http/Query/InvalidQueryParameterException.php index 40e721f6..ded2dfcf 100644 --- a/src/Web/Validation/Exception/InvalidQueryParameterException.php +++ b/src/Http/Query/InvalidQueryParameterException.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,11 +27,14 @@ declare(strict_types=1); -namespace Conjoon\Web\Validation\Exception; +namespace Conjoon\Http\Query; + +use Conjoon\Http\Exception\BadRequestException; /** - * Error indicating that an invalid query parameter was encountered. + * Class InvalidQueryParameterException + * @package Conjoon\Http\Query */ -class InvalidQueryParameterException extends QueryException +class InvalidQueryParameterException extends BadRequestException { } diff --git a/src/Http/Query/QueryTranslator.php b/src/Http/Query/QueryTranslator.php new file mode 100644 index 00000000..553082ad --- /dev/null +++ b/src/Http/Query/QueryTranslator.php @@ -0,0 +1,126 @@ +validateParameters( + $this->extractParameters($parameterResource) + ); + + return $this->translateParameters(new ParameterBag($parameters)); + } + + + /** + * Validates the specified list of parameters against the list of + * expected Parameters. If there are parameters in the submitted list + * this translator does not expect, an exception is thrown. + * + * @param array $parameters + * @return array + * + * @see #getExpectedParameters + * + * @throws InvalidQueryParameterException + */ + protected function validateParameters(array $parameters): array + { + $allowed = $this->getExpectedParameters(); + + $spill = array_diff(array_keys($parameters), $allowed); + if (count($spill) > 0) { + throw new InvalidQueryParameterException( + "found additional parameters " . + "\"" . implode("\", \"", $spill) . "\"" + ); + } + + return $parameters; + } +} diff --git a/src/Http/Request.php b/src/Http/Request.php deleted file mode 100644 index 13c3ffe4..00000000 --- a/src/Http/Request.php +++ /dev/null @@ -1,114 +0,0 @@ -url = $url; - $this->method = $method; - } - - - /** - * Get the URL for the request. - * - * @return Url - */ - public function getUrl(): Url - { - return $this->url; - } - - - /** - * Get the HTTP request method used with this request. - * - * @return RequestMethod - */ - public function getMethod(): RequestMethod - { - return $this->method; - } - - - /** - * Returns the Query-component of the url of this request, or null - * if no query is available. - * - * @return Query|null - */ - public function getQuery(): ?Query - { - if ($this->query) { - return $this->query; - } - - $query = $this->url->getQuery(); - if (!$query) { - return null; - } - - $this->query = new Query($query); - return $this->query; - } -} diff --git a/src/Http/RequestMethod.php b/src/Http/RequestMethod.php deleted file mode 100644 index 2ed0107f..00000000 --- a/src/Http/RequestMethod.php +++ /dev/null @@ -1,94 +0,0 @@ - + * @var array */ public const HTTP_STATUS = [ 400 => "Bad Request", - 401 => "Unauthorized", - 403 => "Forbidden", - 404 => "Not Found", 405 => "Method not allowed", 500 => "Internal Server Error" ]; diff --git a/src/Illuminate/Auth/Imap/ImapUser.php b/src/Illuminate/Auth/Imap/ImapUser.php index 6596c72b..987452cd 100644 --- a/src/Illuminate/Auth/Imap/ImapUser.php +++ b/src/Illuminate/Auth/Imap/ImapUser.php @@ -29,7 +29,7 @@ namespace Conjoon\Illuminate\Auth\Imap; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; use Illuminate\Contracts\Auth\Authenticatable; /** diff --git a/src/Illuminate/Auth/Imap/Util.php b/src/Illuminate/Auth/Imap/Util.php index 31554ba3..f7ecf090 100644 --- a/src/Illuminate/Auth/Imap/Util.php +++ b/src/Illuminate/Auth/Imap/Util.php @@ -29,7 +29,7 @@ namespace Conjoon\Illuminate\Auth\Imap; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; /** * Class Util diff --git a/src/Illuminate/MailClient/Data/Protocol/Http/Request/Transformer/LaravelAttachmentListJsonTransformer.php b/src/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformer.php similarity index 88% rename from src/Illuminate/MailClient/Data/Protocol/Http/Request/Transformer/LaravelAttachmentListJsonTransformer.php rename to src/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformer.php index d74b6e30..03c39394 100644 --- a/src/Illuminate/MailClient/Data/Protocol/Http/Request/Transformer/LaravelAttachmentListJsonTransformer.php +++ b/src/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformer.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Conjoon\Illuminate\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Conjoon\Illuminate\Mail\Client\Request\Attachment\Transformer; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\Protocol\Http\Request\Transformer\AttachmentListJsonTransformer; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Request\Attachment\Transformer\AttachmentListJsonTransformer; use RuntimeException; /** * Class LaravelAttachmentListJsonTransformer - * @package Conjoon\Illuminate\MailClient\Data\Protocol\Http\Request\Transformer + * @package Conjoon\Illuminate\Mail\Client\Request\Attachment\Transformer */ class LaravelAttachmentListJsonTransformer implements AttachmentListJsonTransformer { diff --git a/src/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRule.php b/src/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRule.php deleted file mode 100644 index f05594ea..00000000 --- a/src/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRule.php +++ /dev/null @@ -1,143 +0,0 @@ - $includes - * @param bool $wildcardEnabled - */ - public function __construct( - ObjectDescriptionList $resourceDescriptionList, - array $includes, - bool $wildcardEnabled = false - ) { - parent::__construct($resourceDescriptionList, $includes); - $this->wildcardEnabled = $wildcardEnabled; - } - - - /** - * @inheritdoc - */ - public function supports(object $obj): bool - { - return ($obj instanceof Parameter) && - $this->isGroupParameter($obj) && - $this->getGroupName($obj) === "relfield:fields"; - } - - - /** - * @inheritdoc - */ - protected function validateValue(Parameter $parameter, ValidationErrors $errors): bool - { - $value = $parameter->getValue(); - if ($value === "") { - return true; - } - - $name = $parameter->getName(); - $type = $this->getGroupKey($parameter); - $resourceFields = ($type ? $this->getFields($type) : []) ?? []; - - $fields = explode(",", $value); - - $wildcards = array_filter($fields, fn ($field) => $field === "*"); - if (count($wildcards) > 1) { - $errors[] = new ValidationError( - $parameter, - "The relfield-specification does not allow more than one wildcard for \"$name\"", - 400 - ); - return false; - } - - $wildcardFound = in_array("*", $fields); - if ($wildcardFound && !$this->wildcardEnabled) { - $errors[] = new ValidationError( - $parameter, - "This server does not support wildcards with the relfield-extension", - 400 - ); - return false; - } - - - // remove wildcards - $fields = array_filter($fields, fn ($field) => $field !== "*"); - - - // check if any field is not prefixed with a +/- - $invalidFields = array_filter($fields, fn ($field) => !in_array(substr($field, 0, 1), ["+", "-"])); - if (count($invalidFields) !== 0) { - $errors[] = new ValidationError( - $parameter, - "The relfield-specification expects each field to be prefixed with a \"+\" or a \"-\"" - ); - return false; - } - - // sanitize fields and strip prefixes where applicable - $fields = array_map( - fn ($field) => - in_array(substr($field, 0, 1), ["+", "-"]) - ? substr($field, 1) - : $field, - $fields - ); - - return $this->checkFieldList($fields, $resourceFields, $parameter, $errors); - } -} diff --git a/src/JsonApi/Query/Query.php b/src/JsonApi/Query/Query.php deleted file mode 100644 index c0fd8f87..00000000 --- a/src/JsonApi/Query/Query.php +++ /dev/null @@ -1,67 +0,0 @@ -resourceTarget = $resourceTarget; - } - - - /** - * @return ObjectDescription - */ - public function getResourceTarget(): ObjectDescription - { - return $this->resourceTarget; - } -} diff --git a/src/JsonApi/Query/Validation/CollectionValidator.php b/src/JsonApi/Query/Validation/CollectionValidator.php deleted file mode 100644 index 730ff755..00000000 --- a/src/JsonApi/Query/Validation/CollectionValidator.php +++ /dev/null @@ -1,124 +0,0 @@ -getResourceTarget(); - - $sort = $query->getParameter("sort"); - $sort = $sort - ? $this->getAvailableSortFields($resourceTarget) - : []; - - $list = parent::getParameterRules($query); - $list[] = new ValuesInWhitelistRule("sort", $sort); - - return $list; - } - - - /** - * Returns all the parameter names for a collection query, including sorting parameter options. - * - * @param Query $query - * - * @return array - */ - public function getAllowedParameterNames(HttpQuery $query): array - { - return array_merge( - parent::getAllowedParameterNames($query), - ["sort"] - ); - } - - - /** - * Returns all available fields for the specified $resourceTarget to be used with the sort query parameter. - * The list returned will be an array containing the field names, and dot-separated field names where the - * first part of the name is the type of the resource target. - * - * @param ObjectDescription $resourceTarget - * @return array - */ - protected function getAvailableSortFields(ObjectDescription $resourceTarget): array - { - $res = $this->getAvailableFields($resourceTarget); - - return array_merge($res, array_map(fn ($field) => "-$field", $res)); - } - - - /** - * Returns all available fields for the specified $resourceTarget, along(!) with its relationships. - * The list returned will be an array containing the field names, and dot-separated field names where the - * first part of the name is the type of the resource target, or the related resource target. - * - * @param ObjectDescription $resourceTarget - * @return array - */ - protected function getAvailableFields(ObjectDescription $resourceTarget): array - { - $res = $resourceTarget->getFields(); - - $descriptions = $resourceTarget->getAllRelationshipResourceDescriptions(true); - - foreach ($descriptions as $entity) { - $fields = $entity->getFields(); - $type = $entity->getType(); - $res = array_merge($res, array_map(fn ($field) => "$type.$field", $fields)); - } - - return $res; - } -} diff --git a/src/JsonApi/Query/Validation/Parameter/FieldsetRule.php b/src/JsonApi/Query/Validation/Parameter/FieldsetRule.php deleted file mode 100644 index 6e768b9e..00000000 --- a/src/JsonApi/Query/Validation/Parameter/FieldsetRule.php +++ /dev/null @@ -1,252 +0,0 @@ - $includes - */ - protected array $includes; - - /** - * Constructor. - * Creates a new instance of this rule configured with the available resource object descriptions - * and the includes the rule should consider. - * - * @param ObjectDescriptionList $resourceDescriptionList - * @param array $includes An array with all resource object types requested, - * against which a parameter's fieldset must be validated - */ - public function __construct(ObjectDescriptionList $resourceDescriptionList, array $includes) - { - $this->resourceDescriptionList = $resourceDescriptionList; - $this->includes = $includes; - } - - - /** - * Returns the ObjectDescriptionList this rule uses. - * - * @return ObjectDescriptionList - */ - public function getResourceObjectDescriptions(): ObjectDescriptionList - { - return $this->resourceDescriptionList; - } - - - /** - * Returns the list of includes this rule was configures with - * - * @return array - */ - public function getIncludes(): array - { - return $this->includes; - } - - - /** - * @inheritdoc - */ - public function supports(object $obj): bool - { - /** - * @var Parameter $obj - */ - return parent::supports($obj) && - $this->isGroupParameter($obj) && - $this->getGroupName($obj) === "fields"; - } - - - /** - * @inehritdoc - */ - protected function validate(Parameter $parameter, ValidationErrors $errors): bool - { - $name = $parameter->getName(); - $type = $this->getGroupKey($parameter); - - if (!$this->validateIncludes($parameter, $errors)) { - return false; - } - - $resourceFields = $type ? $this->getFields($type) : null; - - if (!$resourceFields) { - $errors[] = new ValidationError( - $parameter, - "Cannot find fields for parameter \"$name\"", - 400 - ); - return false; - } - - - if (!$this->validateValue($parameter, $errors)) { - return false; - } - - return true; - } - - - /** - * Returns the field for the ObjectDescription identified by $type. - * - * @param string $type - * - * @return array|null - */ - protected function getFields(string $type): ?array - { - return $this->getResourceObjectDescriptions() - ->findBy(fn ($resource) => $resource->getType() === $type)?->getFields(); - } - - - /** - * Validates the key for the specified fieldset group parameter. - * - * @param Parameter $parameter - * @param ValidationErrors $errors - * - * @return bool - */ - protected function validateIncludes(Parameter $parameter, ValidationErrors $errors): bool - { - $includes = $this->getIncludes(); - $type = $this->getGroupKey($parameter); - - if (!in_array($type, $includes)) { - $errors[] = new ValidationError( - $parameter, - "The requested type \"$type\" cannot be found in the list of includes, which was \"" . - implode("\", \"", $includes) . - "\"", - 400 - ); - return false; - } - - return true; - } - - - /** - * Validates the value of the fieldset parameter. - * - * @param Parameter $parameter - * @param ValidationErrors $errors - * - * @return bool - */ - protected function validateValue(Parameter $parameter, ValidationErrors $errors): bool - { - $value = $parameter->getValue(); - $type = $this->getGroupKey($parameter); - $resourceFields = ($type ? $this->getFields($type) : []) ?? []; - - if ($value === "") { - return true; - } - - $fields = explode(",", $value); - - return $this->checkFieldList($fields, $resourceFields, $parameter, $errors); - } - - - /** - * Helper function for validating that the $actualFields appear in $allowedFields. - * - * @param array $actualFields - * @param array $allowedFields - * @param Parameter $parameter - * @param ValidationErrors $errors - * - * @return bool - */ - protected function checkFieldList( - array $actualFields, - array $allowedFields, - Parameter $parameter, - ValidationErrors $errors - ): bool { - $spill = array_diff($actualFields, $allowedFields); - - if (count($spill) === 0) { - return true; - } - - $errors[] = new ValidationError( - $parameter, - "The following fields for \"" . $parameter->getName() . "\" cannot be found " . - "in the resource object: \"" . - implode("\", \"", $spill) . - "\"", - 400 - ); - - return false; - } -} diff --git a/src/JsonApi/Query/Validation/Parameter/IncludeRule.php b/src/JsonApi/Query/Validation/Parameter/IncludeRule.php deleted file mode 100644 index 7c2d3637..00000000 --- a/src/JsonApi/Query/Validation/Parameter/IncludeRule.php +++ /dev/null @@ -1,107 +0,0 @@ -merge($this->parse($parameter->getValue())); - return ArrayUtil::hasOnly(array_flip($source), $whitelist); - } - - - /** - * Returns an array with all "include"-values as specified in the string, each - * relationship to include separated with a ",". - * Returns an empty array for an array string. - * - * @param string $value - * @return array - */ - protected function parse(string $value): array - { - if ($value === "") { - return []; - } - return explode(",", $value); - } - - - /** - * Merges all the includes into the greatest common divisors possible. - * The JSON:API specifies that "intermediate resources in a multi-part - * path must be returned along with the leaf nodes" (@see https://jsonapi.org/format/#fetching-includes). - * A client may send a request with a query parameter "include" in the form of - *
-     * include=MailFolder,MailFolder.MailAccount
-     * 
- * which is a valid value for the "include" query parameter. However, due to the specification - * quoted above, the "MailFolder"-value is redundant, so the includes can be merged from - * ["MailFolder", "MailFolder.MailAccount"] into ["MailFolder.MailAccount"]. - * - * @param array $includes - * @return array - */ - protected function merge(array $includes): array - { - $result = array_values($includes); - foreach ($includes as $include) { - $result = array_filter( - $result, - fn ($item) => $item === $include || strpos($include, $item) !== 0 || strpos($item, $include) === 0 - ); - } - - return array_values($result); - } -} diff --git a/src/JsonApi/Query/Validation/Parameter/PnFilterRule.php b/src/JsonApi/Query/Validation/Parameter/PnFilterRule.php deleted file mode 100644 index 8d2760fc..00000000 --- a/src/JsonApi/Query/Validation/Parameter/PnFilterRule.php +++ /dev/null @@ -1,204 +0,0 @@ -= 1657: - * ?filter={"OR":[{"=":{"recent":true}}, "OR": [{"=": {"unseen": true}}, {">=": {"id":1657}}]} - * - * This rule applies for parameters named "filter" - */ -class PnFilterRule extends JsonEncodedRule -{ - /** - * @var array - */ - protected array $attributes; - - - /** - * Constructor. - * - * @param array $attributes The list of valid attributes this rule considers. - */ - public function __construct(array $attributes) - { - parent::__construct("filter"); - - $this->attributes = $attributes; - } - - /** - * @inheritdoc - */ - protected function validate(Parameter $parameter, ValidationErrors $errors): bool - { - if (!parent::validate($parameter, $errors)) { - return false; - } - - $value = json_decode($parameter->getValue(), true); - - $parse = function ($value) use (&$parse) { - - - foreach ($value as $operator => $filter) { - if (!$this->isValidOperator($operator)) { - return "\"$operator\" is not a valid operator"; - } - - if (!$this->isLogicalOperator($operator)) { - $attributes = array_keys($filter); - $diff = array_values(array_diff($attributes, $this->getAttributes())); - if (count($diff) > 0) { - return "\"$operator\" needs a valid attribute argument, received \"" . implode("\", \"", $diff) . "\""; - } - continue; - } - - //{"OR" : [{"==": ...}, {">=" : ...}}] - if (count($filter) <= 1) { - return "Logical operator \"$operator\" " . - "expects at least 2 operands, " . count($filter) . " given"; - } - - foreach ($filter as $operand) { - $res = $parse($operand); - if (is_string($res)) { - return $res; - } - } - } - - return true; - }; - - $error = $parse($value); - - if (is_string($error)) { - $errors[] = new ValidationError( - $parameter, - $error, - 400 - ); - - return false; - } - - return true; - } - - - /** - * Returns true if the passed argument is a valid operator or function. - * - * @param string $value - * @return bool - */ - public function isValidOperator(string $value): bool - { - return in_array($value, $this->getRelationalOperators()) || - $this->isLogicalOperator($value) || - in_array($value, $this->getFunctions()); - } - - - /** - * Returns true if the submitted argument is a logical operator according to this implementation. - * - * @param string $value - * - * @return bool - */ - public function isLogicalOperator(string $value): bool - { - return in_array($value, $this->getLogicalOperators()); - } - - - /** - * Returns the list of relational operators supported with this rule. - * - * @return string[] - */ - public function getRelationalOperators(): array - { - return array_merge(array_map(fn($enum) => $enum->value, RelationalOperator::cases()), ["="]); - } - - - /** - * Returns the list of logical operators supported with this rule. - * - * @return string[] - */ - public function getLogicalOperators(): array - { - return [LogicalOperator::OR->value, "OR"]; - } - - - /** - * Returns the list of functions supported with this rule. - * - * @return string[] - */ - public function getFunctions(): array - { - return array_map(fn($enum) => $enum->value, FunctionalOperator::cases()); - } - - - /** - * Returns all the attribute names this rule considers. The list of rules is dynamic and must be - * specified with the constructor. - * - * @return array - */ - public function getAttributes(): array - { - return $this->attributes; - } -} diff --git a/src/JsonApi/Query/Validation/Query/QueryRule.php b/src/JsonApi/Query/Validation/Query/QueryRule.php deleted file mode 100644 index 3bbc7f9a..00000000 --- a/src/JsonApi/Query/Validation/Query/QueryRule.php +++ /dev/null @@ -1,46 +0,0 @@ -getResourceTarget(); - - $include = $query->getParameter("include"); - $includes = $include - ? $this->unfoldInclude($include) - : []; - - $list = new ParameterRuleList(); - $list[] = new IncludeRule($resourceTarget->getAllRelationshipPaths()); - $list[] = new FieldsetRule( - $resourceTarget->getAllRelationshipResourceDescriptions(true), - $includes - ); - - return $list; - } - - - /** - * Returns the QueryRules for the specified Query. - * - * @param Query $query - * - * @return QueryRuleList - */ - public function getQueryRules(HttpQuery $query): QueryRuleList - { - $list = new QueryRuleList(); - $list[] = new OnlyParameterNamesRule($this->getAllowedParameterNames($query)); - $list[] = new RequiredParameterNamesRule($this->getRequiredParameterNames($query)); - - return $list; - } - - - /** - * Returns all the parameter names including possible fieldsets based on the Resource Target of the Query. - * - * @param Query $query - * - * @return array - */ - public function getAllowedParameterNames(HttpQuery $query): array - { - $resourceTarget = $query->getResourceTarget(); - - $exp = []; - $list = $this->unfoldRelationships($resourceTarget->getAllRelationshipPaths(true)); - - foreach ($list as $type) { - $exp[] = "fields[$type]"; - } - return array_merge(["include"], $exp); - } - - - /** - * @inheritdoc - * - * @return array - */ - public function getRequiredParameterNames(HttpQuery $query): array - { - return []; - } - - - - /** - * Unfolds possible dot notated types available with includes and returns it as - * an array with all resource types as unique values in the resulting array. - * - * @example - * $this->unfoldInclude( - * new Parameter("include", - * "MailFolder.MailAccount,MailFolder")); // ["MailAccount", "MailFolder"] - * - * - * @param Parameter $parameter - * - * @return array - * - * @throws UnexpectedQueryParameterException - */ - protected function unfoldInclude(Parameter $parameter): array - { - if ($parameter->getName() !== "include") { - throw new UnexpectedQueryParameterException( - "parameter passed does not seem to be the \"include\" parameter" - ); - } - - $includes = $parameter->getValue() ? explode(",", $parameter->getValue()) : null; - - if (!$includes) { - return []; - } - - return $this->unfoldRelationships($includes); - } - - - /** - * Returns an array with all the entries in $relationships reduced to their TYPE-names. - * - * @examnple - * $res = $this->unfoldRelationships(["MailFolder", "MessageItem.MailFolder"]); - * // $res: ["MailFolder", "MessageItem"] - * - * - * @param array $relationships - * @return array - */ - protected function unfoldRelationships(array $relationships): array - { - $res = []; - - foreach ($relationships as $relationship) { - $res = array_merge($res, explode(".", $relationship)); - } - - return array_values(array_unique($res)); - } -} diff --git a/src/JsonApi/Request.php b/src/JsonApi/Request.php deleted file mode 100644 index 7c6582cb..00000000 --- a/src/JsonApi/Request.php +++ /dev/null @@ -1,96 +0,0 @@ -queryValidator = $queryValidator; - } - - - /** - * Returns the query validator for this request, if any was specified with the constructor. - */ - private function getQueryValidator(): ?Validator - { - return $this->queryValidator; - } - - - /** - * Validates the request. - * Will return an ValidationErrors-collection with details about all the errors that were found. - * - * @return ValidationErrors - */ - public function validate(): ValidationErrors - { - $errors = new ValidationErrors(); - $validator = $this->getQueryValidator(); - $query = $this->getQuery(); - - if (!$validator || !$query) { - return $errors; - } - - $validator->validate($query, $errors); - - return $errors; - } -} diff --git a/src/JsonApi/Resource/Resource.php b/src/JsonApi/Resource/Resource.php deleted file mode 100644 index 3c8ab232..00000000 --- a/src/JsonApi/Resource/Resource.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class ResourceList extends AbstractList -{ - /** - * @inheritdoc - * - * @throws InvalidArgumentException|OutOfBoundsException|TypeError - */ - public function offsetSet(mixed $offset, mixed $value): void - { - $this->assertTypeFor($value); - - /** - * @var Resource $value - */ - $value = $this->uriExists($value); - - $this->doInsert($offset, $value); - } - - /** - * Returns the Resource itself if its URI does not already exist in *this* ResourceList. - * - * @param Resource $resource - * @return Resource - * - * @throws InvalidArgumentException if the URI of the resource was already registered with - * this ResourceList. - */ - private function uriExists(Resource $resource): Resource - { - $uri = $resource->getUri(); - - if (count(array_filter($this->data, fn ($res) => $res->getUri()->equals($uri))) > 0) { - throw new InvalidArgumentException( - "A resource for the URI \"" . $uri->toString() . "\" already exists" - ); - } - - return $resource; - } - - - /** - * @return string - */ - public function getEntityType(): string - { - return Resource::class; - } -} diff --git a/src/JsonApi/Resource/ResourceResolver.php b/src/JsonApi/Resource/ResourceResolver.php deleted file mode 100644 index c763ff5d..00000000 --- a/src/JsonApi/Resource/ResourceResolver.php +++ /dev/null @@ -1,98 +0,0 @@ -resolve(Uri::make("https://localhost:8080/directory/employees/1")); // EmployeeResource - * $resolver->resolve(Uri::make("https://localhost:8080/directory/employees")); // EmployeeResourceCollection - * $resolver->resolve(Uri::make("https://localhost:8080/directory/shipments")); // null - * - */ -class ResourceResolver -{ - /** - * @var ResourceList - */ - private ResourceList $locations; - - - /** - * @param ResourceList $locations - */ - public function __construct(ResourceList $locations) - { - $this->locations = $locations; - } - - - /** - * Resolves the specified URI and returns the Resource that is located there. - * Returns null if the URI did not target a registered resource with this ResourceResolver. - * - * @param Uri $uri - * @return Resource|null - */ - public function resolve(Uri $uri): ?Resource - { - foreach ($this->locations as $location) { - if ($location->getUri()->match($uri) !== null) { - return $location; - } - } - return null; - } -} diff --git a/src/JsonProblem/ForbiddenProblem.php b/src/JsonProblem/ForbiddenProblem.php deleted file mode 100644 index b652f2a3..00000000 --- a/src/JsonProblem/ForbiddenProblem.php +++ /dev/null @@ -1,50 +0,0 @@ -data as $problem) { - $res[] = $problem->toArray(); - } - - return $res; - } - - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - return $strategy ? $strategy->toJson($this) : $this->toArray(); - } -} diff --git a/src/JsonProblem/UnauthorizedProblem.php b/src/JsonProblem/UnauthorizedProblem.php deleted file mode 100644 index 35554db0..00000000 --- a/src/JsonProblem/UnauthorizedProblem.php +++ /dev/null @@ -1,50 +0,0 @@ -attachmentKey ? $this->attachmentKey->toArray() : [], + $this->attachmentKey ? $this->attachmentKey->toJson() : [], [ "text" => $this->getText(), "type" => $this->getType(), diff --git a/src/MailClient/Message/Attachment/FileAttachment.php b/src/Mail/Client/Attachment/FileAttachment.php similarity index 94% rename from src/MailClient/Message/Attachment/FileAttachment.php rename to src/Mail/Client/Attachment/FileAttachment.php index 37bd4908..9a0b06f2 100644 --- a/src/MailClient/Message/Attachment/FileAttachment.php +++ b/src/Mail/Client/Attachment/FileAttachment.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment; +namespace Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\Util\ArrayUtil; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\ArrayUtil; +use Conjoon\Util\JsonStrategy; use InvalidArgumentException; /** @@ -48,7 +48,7 @@ * $keyedAttachment = $attachment->setAttachmentKey(new AttachmentKey("x", "y", "z", "2")); * $keyedAttachment !== $attachment; // true * - * @package Conjoon\MailClient\Message\Attachment + * @package Conjoon\Mail\Client\Attachment * * @method string getContent() * @method string getEncoding() diff --git a/src/MailClient/Message/Attachment/FileAttachmentItem.php b/src/Mail/Client/Attachment/FileAttachmentItem.php similarity index 93% rename from src/MailClient/Message/Attachment/FileAttachmentItem.php rename to src/Mail/Client/Attachment/FileAttachmentItem.php index af00442b..e5706323 100644 --- a/src/MailClient/Message/Attachment/FileAttachmentItem.php +++ b/src/Mail/Client/Attachment/FileAttachmentItem.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment; +namespace Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\JsonStrategy; use InvalidArgumentException; /** * FileAttachmentItem models a downloadable email message file-attachment, * providing a preview-src and a download url. * - * @package Conjoon\MailClient\Message\Attachment + * @package Conjoon\Mail\Client\Attachment * * @method string getPreviewImgSrc() * @method string getDownloadUrl() diff --git a/src/MailClient/Message/Attachment/FileAttachmentItemList.php b/src/Mail/Client/Attachment/FileAttachmentItemList.php similarity index 90% rename from src/MailClient/Message/Attachment/FileAttachmentItemList.php rename to src/Mail/Client/Attachment/FileAttachmentItemList.php index 2c50e86a..d7a23466 100644 --- a/src/MailClient/Message/Attachment/FileAttachmentItemList.php +++ b/src/Mail/Client/Attachment/FileAttachmentItemList.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment; +namespace Conjoon\Mail\Client\Attachment; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; /** * Class FileAttachmentItemList organizes a list of FileAttachmentItems. * * - * @package Conjoon\MailClient\Message\Attachment + * @package Conjoon\Mail\Client\Attachment */ class FileAttachmentItemList extends AbstractList implements Jsonable { diff --git a/src/MailClient/Message/Attachment/FileAttachmentList.php b/src/Mail/Client/Attachment/FileAttachmentList.php similarity index 89% rename from src/MailClient/Message/Attachment/FileAttachmentList.php rename to src/Mail/Client/Attachment/FileAttachmentList.php index a9dedec4..8e914969 100644 --- a/src/MailClient/Message/Attachment/FileAttachmentList.php +++ b/src/Mail/Client/Attachment/FileAttachmentList.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment; +namespace Conjoon\Mail\Client\Attachment; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; /** * Class FileAttachmentList organizes a list of FileAttachments. * - * @package Conjoon\MailClient\Message\Attachment + * @package Conjoon\Mail\Client\Attachment */ class FileAttachmentList extends AbstractList implements Jsonable { diff --git a/src/MailClient/Message/Attachment/Processor/FileAttachmentProcessor.php b/src/Mail/Client/Attachment/Processor/FileAttachmentProcessor.php similarity index 89% rename from src/MailClient/Message/Attachment/Processor/FileAttachmentProcessor.php rename to src/Mail/Client/Attachment/Processor/FileAttachmentProcessor.php index 758637ed..b58d437f 100644 --- a/src/MailClient/Message/Attachment/Processor/FileAttachmentProcessor.php +++ b/src/Mail/Client/Attachment/Processor/FileAttachmentProcessor.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment\Processor; +namespace Conjoon\Mail\Client\Attachment\Processor; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItem; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentItem; /** * Interface FileAttachmentProcessor. * Contract for converting a FileAttachment to a FileAttachmentItem to provide * a download and preview for the contents of a FileAttachment. * - * @package Conjoon\MailClient\Message\Attachment\Processor + * @package Conjoon\Mail\Client\Attachment\Processor */ interface FileAttachmentProcessor { diff --git a/src/MailClient/Message/Attachment/Processor/InlineDataProcessor.php b/src/Mail/Client/Attachment/Processor/InlineDataProcessor.php similarity index 90% rename from src/MailClient/Message/Attachment/Processor/InlineDataProcessor.php rename to src/Mail/Client/Attachment/Processor/InlineDataProcessor.php index 4e249418..89b91ec2 100644 --- a/src/MailClient/Message/Attachment/Processor/InlineDataProcessor.php +++ b/src/Mail/Client/Attachment/Processor/InlineDataProcessor.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment\Processor; +namespace Conjoon\Mail\Client\Attachment\Processor; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItem; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentItem; /** * Class InlineDataProcessor. * Provides inline data for downloadUrl and previewImgSrc, if applicable * - * @package Conjoon\MailClient\Message\Attachment\Processor + * @package Conjoon\Mail\Client\Attachment\Processor */ class InlineDataProcessor implements FileAttachmentProcessor { diff --git a/src/MailClient/Message/Attachment/Processor/ProcessorException.php b/src/Mail/Client/Attachment/Processor/ProcessorException.php similarity index 88% rename from src/MailClient/Message/Attachment/Processor/ProcessorException.php rename to src/Mail/Client/Attachment/Processor/ProcessorException.php index 5284b095..1091e8c4 100644 --- a/src/MailClient/Message/Attachment/Processor/ProcessorException.php +++ b/src/Mail/Client/Attachment/Processor/ProcessorException.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Attachment\Processor; +namespace Conjoon\Mail\Client\Attachment\Processor; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\MailClientException; /** * Class ProcessorException * - * @package Conjoon\MailClient\Message\Attachment\Processor + * @package Conjoon\Mail\Client\Attachment\Processor */ class ProcessorException extends MailClientException { diff --git a/src/MailClient/Data/CompoundKey/AttachmentKey.php b/src/Mail/Client/Data/CompoundKey/AttachmentKey.php similarity index 93% rename from src/MailClient/Data/CompoundKey/AttachmentKey.php rename to src/Mail/Client/Data/CompoundKey/AttachmentKey.php index 7b008290..2ff37813 100644 --- a/src/MailClient/Data/CompoundKey/AttachmentKey.php +++ b/src/Mail/Client/Data/CompoundKey/AttachmentKey.php @@ -27,12 +27,12 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\CompoundKey; +namespace Conjoon\Mail\Client\Data\CompoundKey; /** * Class AttachmentKey. * - * @package Conjoon\MailClient\Data\CompoundKey + * @package Conjoon\Mail\Client\Data\CompoundKey */ class AttachmentKey extends MessageItemChildCompoundKey { diff --git a/src/MailClient/Data/CompoundKey/CompoundKey.php b/src/Mail/Client/Data/CompoundKey/CompoundKey.php similarity index 82% rename from src/MailClient/Data/CompoundKey/CompoundKey.php rename to src/Mail/Client/Data/CompoundKey/CompoundKey.php index 220dcea1..b3418997 100644 --- a/src/MailClient/Data/CompoundKey/CompoundKey.php +++ b/src/Mail/Client/Data/CompoundKey/CompoundKey.php @@ -27,12 +27,12 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\CompoundKey; +namespace Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\Core\Contract\StringStrategy; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Stringable; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; +use Conjoon\Util\Stringable; /** * Class MessageKey models base class for compound keys for identifying (IMAP) Messages. @@ -42,9 +42,9 @@ * using the CompoundKey can be identified. * * - * @package Conjoon\MailClient\Data\CompoundKey + * @package Conjoon\Mail\Client\Data\CompoundKey */ -abstract class CompoundKey implements Arrayable, Stringable +abstract class CompoundKey implements Jsonable, Stringable { /** * @var string @@ -97,7 +97,7 @@ public function getId(): string * * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { return [ 'id' => $this->getId(), @@ -107,13 +107,10 @@ public function toArray(): array /** - * @inheritdoc + * @return string */ - public function toString(StringStrategy $strategy = null): string + public function toString(): string { - if ($strategy) { - return $strategy->toString($this); - } - return json_encode($this->toArray()); + return json_encode($this->toJson()); } } diff --git a/src/MailClient/Data/CompoundKey/FolderKey.php b/src/Mail/Client/Data/CompoundKey/FolderKey.php similarity index 93% rename from src/MailClient/Data/CompoundKey/FolderKey.php rename to src/Mail/Client/Data/CompoundKey/FolderKey.php index 2ee3f328..53abe8f4 100644 --- a/src/MailClient/Data/CompoundKey/FolderKey.php +++ b/src/Mail/Client/Data/CompoundKey/FolderKey.php @@ -27,12 +27,12 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\CompoundKey; +namespace Conjoon\Mail\Client\Data\CompoundKey; /** * Class FolderKey models a class for compound keys for identifying (IMAP) Folders. * - * @package Conjoon\MailClient\Data\CompoundKey + * @package Conjoon\Mail\Client\Data\CompoundKey */ class FolderKey extends CompoundKey { diff --git a/src/MailClient/Data/CompoundKey/MessageItemChildCompoundKey.php b/src/Mail/Client/Data/CompoundKey/MessageItemChildCompoundKey.php similarity index 94% rename from src/MailClient/Data/CompoundKey/MessageItemChildCompoundKey.php rename to src/Mail/Client/Data/CompoundKey/MessageItemChildCompoundKey.php index 6580822d..e28a92cf 100644 --- a/src/MailClient/Data/CompoundKey/MessageItemChildCompoundKey.php +++ b/src/Mail/Client/Data/CompoundKey/MessageItemChildCompoundKey.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\CompoundKey; +namespace Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Util\JsonStrategy; use InvalidArgumentException; /** * Class MessageItemChildCompoundKey models a class for compound keys for entities belonging * to Messages, such as attachments. * - * @package Conjoon\MailClient\Data\CompoundKey + * @package Conjoon\Mail\Client\Data\CompoundKey */ abstract class MessageItemChildCompoundKey extends MessageKey { @@ -125,9 +125,9 @@ public function equals(MessageItemChildCompoundKey $key): bool * * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { - $json = parent::toArray(); + $json = parent::toJson(); $json["parentMessageItemId"] = $this->getParentMessageItemId(); return $json; diff --git a/src/MailClient/Data/CompoundKey/MessageKey.php b/src/Mail/Client/Data/CompoundKey/MessageKey.php similarity index 93% rename from src/MailClient/Data/CompoundKey/MessageKey.php rename to src/Mail/Client/Data/CompoundKey/MessageKey.php index 6ea4ff4a..09d12fce 100644 --- a/src/MailClient/Data/CompoundKey/MessageKey.php +++ b/src/Mail/Client/Data/CompoundKey/MessageKey.php @@ -27,10 +27,10 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\CompoundKey; +namespace Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Util\JsonStrategy; use InvalidArgumentException; /** @@ -45,7 +45,7 @@ * * // passing a MailAccount * new MessageKey( - * new \Conjoon\MailClient\Data\MailAccount(["id" => "dev"]), + * new \Conjoon\Mail\Client\Data\MailAccount(["id" => "dev"]), * "INBOX", * "123" * ); @@ -56,7 +56,7 @@ * "123" * ); * - * @package Conjoon\MailClient\Data\CompoundKey + * @package Conjoon\Mail\Client\Data\CompoundKey */ class MessageKey extends CompoundKey { @@ -164,9 +164,9 @@ public function getFolderKey(): FolderKey * * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { - $json = parent::toArray(); + $json = parent::toJson(); $json["mailFolderId"] = $this->getMailFolderId(); return $json; diff --git a/src/MailClient/Data/DataException.php b/src/Mail/Client/Data/DataException.php similarity index 91% rename from src/MailClient/Data/DataException.php rename to src/Mail/Client/Data/DataException.php index 51d48f10..5dda2597 100644 --- a/src/MailClient/Data/DataException.php +++ b/src/Mail/Client/Data/DataException.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data; +namespace Conjoon\Mail\Client\Data; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\MailClientException; /** * Class DataException * - * @package Conjoon\MailClient\Data + * @package Conjoon\Mail\Client\Data */ class DataException extends MailClientException { diff --git a/src/MailClient/Data/MailAccount.php b/src/Mail/Client/Data/MailAccount.php similarity index 97% rename from src/MailClient/Data/MailAccount.php rename to src/Mail/Client/Data/MailAccount.php index dd19321a..57966942 100644 --- a/src/MailClient/Data/MailAccount.php +++ b/src/Mail/Client/Data/MailAccount.php @@ -27,12 +27,13 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data; +namespace Conjoon\Mail\Client\Data; use BadMethodCallException; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Util\JsonApiStrategy; +use Conjoon\Util\Arrayable; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; /** * Class MailAccount models account information for a mail server. @@ -64,7 +65,7 @@ * * The property "root" allows for specifying a root mailbox and defaults to "INBOX". * - * @package Conjoon\MailClient\Data + * @package Conjoon\Mail\Client\Data * * @method string getName() * @method array getFrom() @@ -250,4 +251,5 @@ public function toJson(JsonStrategy $strategy = null): array { return $strategy ? $strategy->toJson($this) : $this->toArray(); } + } diff --git a/src/MailClient/Data/MailAddress.php b/src/Mail/Client/Data/MailAddress.php similarity index 83% rename from src/MailClient/Data/MailAddress.php rename to src/Mail/Client/Data/MailAddress.php index b7e484c5..b3c29bd3 100644 --- a/src/MailClient/Data/MailAddress.php +++ b/src/Mail/Client/Data/MailAddress.php @@ -27,16 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data; - -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Copyable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonDecodable; -use Conjoon\Core\Contract\StringStrategy; -use Conjoon\Core\Exception\JsonDecodeException; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\Core\Contract\Stringable; +namespace Conjoon\Mail\Client\Data; + +use Conjoon\Util\Copyable; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodable; +use Conjoon\Util\JsonDecodeException; +use Conjoon\Util\JsonStrategy; +use Conjoon\Util\Stringable; use InvalidArgumentException; /** @@ -58,9 +56,9 @@ * $address2 = clone $address; * $address === $address2; //false * - * @package Conjoon\MailClient\Data + * @package Conjoon\Mail\Client\Data */ -class MailAddress implements Stringable, JsonDecodable, Copyable, Arrayable, Jsonable +class MailAddress implements Stringable, JsonDecodable, Copyable, Jsonable { /** * @var string @@ -169,20 +167,16 @@ public static function fromString(string $value): Jsonable /** * Returns a string representation of this email address. * - * @param StringStrategy|null $stringStrategy * @return string * @example * $address = new MailAddress("PeterParker@newyork.com", "Peter Parker"); * * $address->toString(); // returns "Peter Parker " + * */ - public function toString(StringStrategy $stringStrategy = null): string + public function toString(): string { - if ($stringStrategy) { - return $stringStrategy->toString($this); - } - $address = $this->getAddress(); $name = $this->getName(); @@ -191,7 +185,7 @@ public function toString(StringStrategy $stringStrategy = null): string // -------------------------------- -// Arrayable interface +// Jsonable interface // -------------------------------- /** @@ -204,7 +198,7 @@ public function toString(StringStrategy $stringStrategy = null): string * * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { return [ @@ -212,16 +206,4 @@ public function toArray(): array 'name' => $this->getName() ]; } - -// -------------------------------- -// Jsonable interface -// -------------------------------- - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $jsonStrategy = null): array - { - return $jsonStrategy ? $jsonStrategy->toJson($this) : $this->toArray(); - } } diff --git a/src/MailClient/Data/MailAddressList.php b/src/Mail/Client/Data/MailAddressList.php similarity index 81% rename from src/MailClient/Data/MailAddressList.php rename to src/Mail/Client/Data/MailAddressList.php index 54da38c3..070cee6e 100644 --- a/src/MailClient/Data/MailAddressList.php +++ b/src/Mail/Client/Data/MailAddressList.php @@ -27,17 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data; - -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Copyable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonDecodable; -use Conjoon\Core\Contract\StringStrategy; -use Conjoon\Core\Exception\JsonDecodeException; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\Core\Contract\Stringable; +namespace Conjoon\Mail\Client\Data; + +use Conjoon\Util\AbstractList; +use Conjoon\Util\Copyable; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodable; +use Conjoon\Util\JsonDecodeException; +use Conjoon\Util\JsonStrategy; +use Conjoon\Util\Stringable; /** * Class MailAddressList organizes a list of MailAddresses. @@ -53,9 +51,9 @@ * // iterating over the item * } * - * @package Conjoon\MailClient\Data + * @package Conjoon\Mail\Client\Data */ -class MailAddressList extends AbstractList implements JsonDecodable, Stringable, Copyable, Arrayable, Jsonable +class MailAddressList extends AbstractList implements JsonDecodable, Stringable, Copyable, Jsonable { // -------------------------------- // Copyable interface @@ -139,7 +137,6 @@ public static function fromString(string $value): Jsonable /** * Returns a string representation of this email address list. * - * @param StringStrategy|null $stringStrategy * @return string * @example * $list = new MailAddressList(); @@ -147,12 +144,10 @@ public static function fromString(string $value): Jsonable * $list[] = new MailAddress("PeterGriffin@quahog.com", "Peter Griffin"); * * $list->toString(); // returns "Peter Parker , Peter Griffin " + * */ - public function toString(StringStrategy $stringStrategy = null): string + public function toString(): string { - if ($stringStrategy) { - return $stringStrategy->toString($this); - } $data = []; foreach ($this->data as $address) { @@ -164,7 +159,7 @@ public function toString(StringStrategy $stringStrategy = null): string // -------------------------------- -// Arrayable interface +// Jsonable interface // -------------------------------- /** @@ -172,33 +167,21 @@ public function toString(StringStrategy $stringStrategy = null): string * * @return array * - * @see MailAddress::toArray() + * @see MailAddress::toJson() */ - public function toArray(): array + public function toJson(JsonStrategy $jsonStrategy = null): array { $d = []; foreach ($this->data as $address) { - $d[] = $address->toArray(); + $d[] = $address->toJson(); } return $d; } -// -------------------------------- -// Jsonable interface -// -------------------------------- - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $jsonStrategy = null): array - { - return $jsonStrategy ? $jsonStrategy->toJson($this) : $this->toArray(); - } - // ------------------------- // AbstractList diff --git a/src/MailClient/Folder/AbstractMailFolder.php b/src/Mail/Client/Folder/AbstractMailFolder.php similarity index 68% rename from src/MailClient/Folder/AbstractMailFolder.php rename to src/Mail/Client/Folder/AbstractMailFolder.php index 216cbe7f..c6df0d3d 100644 --- a/src/MailClient/Folder/AbstractMailFolder.php +++ b/src/Mail/Client/Folder/AbstractMailFolder.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder; +namespace Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; use InvalidArgumentException; /** * AbstractMailFolder models base information for a MailFolder. * - * @package Conjoon\MailClient\Folder + * @package Conjoon\Mail\Client\Folder */ abstract class AbstractMailFolder { @@ -46,20 +46,15 @@ abstract class AbstractMailFolder /** - * @var string|null + * @var string */ - protected ?string $name = null; + protected string $name; /** - * @var int|null + * @var int */ - protected ?int $unreadMessages = null; - - /** - * @var int|null - */ - protected ?int $totalMessages = null; + protected int $unreadCount; /** @@ -67,11 +62,28 @@ abstract class AbstractMailFolder * * @param FolderKey $folderKey * @param array|null $data + * + * @throws InvalidArgumentException if the name or unreadCount + * in $data is missing */ public function __construct(FolderKey $folderKey, array $data) { + $this->folderKey = $folderKey; + $missing = ""; + if (!isset($data["unreadCount"])) { + $missing = "unreadCount"; + } elseif (!isset($data["name"])) { + $missing = "name"; + } + + if ($missing) { + throw new InvalidArgumentException( + "value for property \"" . $missing . "\" missing" + ); + } + foreach ($data as $key => $value) { if (property_exists($this, $key)) { $method = "set" . ucfirst($key); @@ -107,52 +119,30 @@ protected function setName(string $name) * Returns the name for this ListMailFolder. * @return string */ - public function getName(): ?string + public function getName(): string { return $this->name; } /** - * Sets the number of unread messages for this ListMailFolder. - * - * @param int $unreadMessages - */ - protected function setUnreadMessages(int $unreadMessages) - { - $this->unreadMessages = $unreadMessages; - } - - - /** - * Returns the number of unread messages for this ListMailFolder. - * - * @return int - */ - public function getUnreadMessages(): ?int - { - return $this->unreadMessages; - } - - - /** - * Sets the number of total messages for this ListMailFolder. + * Sets the unread count for this ListMailFolder. * - * @param int $totalMessages + * @param int $unreadCount */ - protected function setTotalMessages(int $totalMessages) + protected function setUnreadCount(int $unreadCount) { - $this->totalMessages = $totalMessages; + $this->unreadCount = $unreadCount; } /** - * Returns the number of total messages for this ListMailFolder. + * Returns the unread count for this ListMailFolder. * * @return int */ - public function getTotalMessages(): ?int + public function getUnreadCount(): int { - return $this->totalMessages; + return $this->unreadCount; } } diff --git a/src/MailClient/Folder/FolderIdToTypeMapper.php b/src/Mail/Client/Folder/FolderIdToTypeMapper.php similarity index 95% rename from src/MailClient/Folder/FolderIdToTypeMapper.php rename to src/Mail/Client/Folder/FolderIdToTypeMapper.php index d00b284f..28237a89 100644 --- a/src/MailClient/Folder/FolderIdToTypeMapper.php +++ b/src/Mail/Client/Folder/FolderIdToTypeMapper.php @@ -27,12 +27,12 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder; +namespace Conjoon\Mail\Client\Folder; /** * Interface FolderIdToTypeMapper. * - * @package Conjoon\MailClient\Folder + * @package Conjoon\Mail\Client\Folder */ interface FolderIdToTypeMapper { diff --git a/src/MailClient/Folder/ListMailFolder.php b/src/Mail/Client/Folder/ListMailFolder.php similarity index 93% rename from src/MailClient/Folder/ListMailFolder.php rename to src/Mail/Client/Folder/ListMailFolder.php index 4bbc3760..42fc5bdc 100644 --- a/src/MailClient/Folder/ListMailFolder.php +++ b/src/Mail/Client/Folder/ListMailFolder.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder; +namespace Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; use InvalidArgumentException; /** @@ -43,8 +43,7 @@ * [ * "name" => "INBOX.Some Folder", * "delimiter" => "." - * "unreadMessages" => 4, - * "totalMessages" => 100, + * "unreadCount" => 4 * ] * ); * @@ -53,7 +52,7 @@ * * * - * @package Conjoon\MailClient\Folder + * @package Conjoon\Mail\Client\Folder */ class ListMailFolder extends AbstractMailFolder { diff --git a/src/MailClient/Folder/MailFolder.php b/src/Mail/Client/Folder/MailFolder.php similarity index 64% rename from src/MailClient/Folder/MailFolder.php rename to src/Mail/Client/Folder/MailFolder.php index f4ae7611..faa2d231 100644 --- a/src/MailClient/Folder/MailFolder.php +++ b/src/Mail/Client/Folder/MailFolder.php @@ -27,12 +27,11 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder; +namespace Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; use InvalidArgumentException; /** @@ -47,8 +46,7 @@ * [ * "name" => "INBOX.Some Folder", * "folderType" => "INBOX" - * "unreadMessages" => 4, - * "totalMessages" => 756 + * "unreadCount" => 4 * ] * ); * @@ -57,9 +55,9 @@ * * * - * @package Conjoon\MailClient\Folder + * @package Conjoon\Mail\Client\Folder */ -class MailFolder extends AbstractMailFolder implements Jsonable, Arrayable +class MailFolder extends AbstractMailFolder implements Jsonable { public const TYPE_INBOX = "INBOX"; @@ -75,9 +73,9 @@ class MailFolder extends AbstractMailFolder implements Jsonable, Arrayable /** - * @var string|null + * @var string */ - protected ?string $folderType = null; + protected string $folderType; /** * @var MailFolderChildList|null @@ -86,18 +84,20 @@ class MailFolder extends AbstractMailFolder implements Jsonable, Arrayable /** - * Will initialize this MailFolderChildList except stated otherwise. + * @inheritdoc * - * @param FolderKey $folderKey - * @param array $data + * @throws InvalidArgumentException if folderType in $data is missing */ public function __construct(FolderKey $folderKey, array $data) { - parent::__construct($folderKey, $data); - if (!array_key_exists("data", $data)) { - $this->data = new MailFolderChildList(); + if (!isset($data["folderType"])) { + throw new InvalidArgumentException( + "value for property \"folderType\" missing" + ); } + + parent::__construct($folderKey, $data); } @@ -108,14 +108,9 @@ public function __construct(FolderKey $folderKey, array $data) * @throws InvalidArgumentException if $type has not a valid * value */ - public function setFolderType(?string $folderType) + public function setFolderType(string $folderType) { - if ($folderType === null) { - $this->folderType = $folderType; - return; - } - $types = [ self::TYPE_INBOX, self::TYPE_DRAFT, self::TYPE_JUNK, self::TYPE_TRASH, self::TYPE_SENT, self::TYPE_FOLDER @@ -133,9 +128,9 @@ public function setFolderType(?string $folderType) /** * Returns the type of this folder. - * @return string|null + * @return string */ - public function getFolderType(): ?string + public function getFolderType(): string { return $this->folderType; } @@ -146,29 +141,12 @@ public function getFolderType(): ?string * * @return MailFolderChildList */ - public function getData(): ?MailFolderChildList + public function getData(): MailFolderChildList { - return $this->data; - } - - - /** - * Setter for data. Will allow for passing null to explicitely nullify - * this mail folders child list, so it may not be considered when transforming - * to a DTO. - * - * @param MailFolder|null $mailFolder - * - * @return void - */ - public function setData(?MailFolder $mailFolder): ?MailFolder - { - if ($mailFolder === null) { - $this->data = null; - return null; + if (!$this->data) { + $this->data = new MailFolderChildList(); } - - return $this->addMailFolder($mailFolder); + return $this->data; } @@ -177,56 +155,38 @@ public function setData(?MailFolder $mailFolder): ?MailFolder * * @param MailFolder $mailFolder * - * @return MailFolder the added MailFolder + * @return MailFolder this */ public function addMailFolder(MailFolder $mailFolder): MailFolder { + if (!$this->data) { $this->data = new MailFolderChildList(); } $this->data[] = $mailFolder; - return $mailFolder; + return $this; } + // +------------------------------- -// | Arrayable interface +// | Jsonable interface // +------------------------------- /** * @inheritdoc */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { - $id = $this->getFolderKey()->getId(); - - $type = "MailFolder"; - $arr = [ - "type" => $type, + $json = [ "name" => $this->getName(), - "unreadMessages" => $this->getUnreadMessages(), - "totalMessages" => $this->getTotalMessages(), + "unreadCount" => $this->getUnreadCount(), "folderType" => $this->getFolderType(), - "data" => $this->getData() ? $this->getData()->toArray() : null + "data" => $this->getData() ? $this->getData()->toJson() : [] ]; - return array_filter( - array_merge($this->getFolderKey()->toArray(), $arr), - fn($value) => $value !== null - ); - } - -// +------------------------------- -// | Jsonable interface -// +------------------------------- - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - return $strategy ? $strategy->toJson($this) : $this->toArray(); + return array_merge($this->getFolderKey()->toJson(), $json); } } diff --git a/src/MailClient/Folder/MailFolderChildList.php b/src/Mail/Client/Folder/MailFolderChildList.php similarity index 75% rename from src/MailClient/Folder/MailFolderChildList.php rename to src/Mail/Client/Folder/MailFolderChildList.php index f0673a40..0e1a6997 100644 --- a/src/MailClient/Folder/MailFolderChildList.php +++ b/src/Mail/Client/Folder/MailFolderChildList.php @@ -27,12 +27,11 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder; +namespace Conjoon\Mail\Client\Folder; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; /** * Class MailFolderList organizes a list of ListMailFolders. @@ -42,7 +41,7 @@ * $list = new MailFolderChildList(); * * $mailFolder = new MailFolder( - * new FolderKey("dev", "INBOX"), ["name" => "INBOX", "unreadMessages" => 23, "totalMessages" => 100] + * new FolderKey("dev", "INBOX"), ["name" => "INBOX", "unreadCount" => 23] * ); * $list[] = $listMailFolder; * @@ -50,9 +49,9 @@ * // iterating over the item * } * - * @package Conjoon\MailClient\Folder + * @package Conjoon\Mail\Client\Folder */ -class MailFolderChildList extends AbstractList implements Arrayable, Jsonable +class MailFolderChildList extends AbstractList implements Jsonable { // ------------------------- // AbstractList @@ -68,30 +67,22 @@ public function getEntityType(): string // ------------------------- -// Arrayable, Jsonable +// Jsonable // ------------------------- /** * @inheritdoc */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { $data = []; foreach ($this->data as $mailFolder) { - $data[] = $mailFolder->toArray(); + $data[] = $mailFolder->toJson(); } - return $data; - } - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $jsonStrategy = null): array - { - return $jsonStrategy ? $jsonStrategy->toJson($this) : $this->toArray(); + return $data; } } diff --git a/src/MailClient/Folder/MailFolderList.php b/src/Mail/Client/Folder/MailFolderList.php similarity index 85% rename from src/MailClient/Folder/MailFolderList.php rename to src/Mail/Client/Folder/MailFolderList.php index 55665e35..1a6e2d0c 100644 --- a/src/MailClient/Folder/MailFolderList.php +++ b/src/Mail/Client/Folder/MailFolderList.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder; +namespace Conjoon\Mail\Client\Folder; -use Conjoon\Core\AbstractList; +use Conjoon\Util\AbstractList; /** * Class MailFolderList organizes a list of ListMailFolders. @@ -39,19 +39,15 @@ * $list = new MailFolderList(); * * $listMailFolder = new ListMailFolder( - * new FolderKey("dev", "INBOX"), [ - * "delimiter" => ".", - * "name" => "INBOX", - * "unreadMessages" => 23, - * "totalMessages" => 100 - * ]); + * new FolderKey("dev", "INBOX"), ["delimiter" => ".", "name" => "INBOX", "unreadCount" => 23] + * ); * $list[] = $listMailFolder; * * foreach ($list as $key => $mItem) { * // iterating over the item * } * - * @package Conjoon\MailClient\Folder + * @package Conjoon\Mail\Client\Folder */ class MailFolderList extends AbstractList { diff --git a/src/MailClient/Folder/Tree/DefaultMailFolderTreeBuilder.php b/src/Mail/Client/Folder/Tree/DefaultMailFolderTreeBuilder.php similarity index 55% rename from src/MailClient/Folder/Tree/DefaultMailFolderTreeBuilder.php rename to src/Mail/Client/Folder/Tree/DefaultMailFolderTreeBuilder.php index d1ea62ee..34328173 100644 --- a/src/MailClient/Folder/Tree/DefaultMailFolderTreeBuilder.php +++ b/src/Mail/Client/Folder/Tree/DefaultMailFolderTreeBuilder.php @@ -27,22 +27,20 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder\Tree; +namespace Conjoon\Mail\Client\Folder\Tree; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; -use Conjoon\MailClient\Folder\FolderIdToTypeMapper; -use Conjoon\MailClient\Folder\ListMailFolder; -use Conjoon\MailClient\Folder\MailFolder; -use Conjoon\MailClient\Folder\MailFolderChildList; -use Conjoon\MailClient\Folder\MailFolderList; -use InvalidArgumentException; +use Conjoon\Mail\Client\Folder\FolderIdToTypeMapper; +use Conjoon\Mail\Client\Folder\ListMailFolder; +use Conjoon\Mail\Client\Folder\MailFolder; +use Conjoon\Mail\Client\Folder\MailFolderChildList; +use Conjoon\Mail\Client\Folder\MailFolderList; /** * Class DefaultMailFolderTreeBuilder. * Default implementation for a MailFolderTreeBuilder. * * - * @package Conjoon\MailClient\Folder\Tree + * @package Conjoon\Mail\Client\Folder\Tree */ class DefaultMailFolderTreeBuilder implements MailFolderTreeBuilder { @@ -51,10 +49,6 @@ class DefaultMailFolderTreeBuilder implements MailFolderTreeBuilder */ protected FolderIdToTypeMapper $folderIdToTypeMapper; - /** - * @var array|null - */ - protected ?array $valueCallbacks = null; /** * DefaultMailFolderTreeBuilder constructor. @@ -82,51 +76,38 @@ public function getFolderIdToTypeMapper(): FolderIdToTypeMapper /** * @inheritdoc */ - public function listToTree( - MailFolderList $mailFolderList, - array $root, - MailFolderListQuery $query - ): MailFolderChildList { + public function listToTree(MailFolderList $mailFolderList, array $root): MailFolderChildList + { + $folders = []; - $fields = $query->getFields(); - $includeChildNodes = in_array("data", $fields); $systemFolderTypes = []; foreach ($mailFolderList as $mailbox) { - if ($this->shouldSkipMailFolder($mailbox, $root, $includeChildNodes)) { + if ($this->shouldSkipMailFolder($mailbox, $root)) { continue; } $parts = explode($mailbox->getDelimiter(), $mailbox->getFolderKey()->getId()); array_pop($parts); + $nameParts = explode($mailbox->getDelimiter(), $mailbox->getName()); + $name = array_pop($nameParts); - $fieldValueMap = []; - $folderType = null; - foreach ($fields as $field) { - if ($field === "data") { - continue; - } - if ($field === "folderType") { - $folderType = $this->buildFolderType($mailbox, $systemFolderTypes); - $fieldValueMap[$field] = $folderType; - continue; - } - $fieldValueMap[$field] = $this->getValueForField($mailbox, $field); - } + $folderType = $this->getFolderIdToTypeMapper()->getFolderType($mailbox); - // nullify the date field since it should not be considered - if (!$includeChildNodes) { - $fieldValueMap["data"] = null; + if (in_array($folderType, $systemFolderTypes)) { + $folderType = MailFolder::TYPE_FOLDER; } $mailFolder = new MailFolder( $mailbox->getFolderKey(), - $fieldValueMap + ["name" => $name, + "unreadCount" => $mailbox->getUnreadCount(), + "folderType" => $folderType] ); - if ($folderType !== null && $folderType !== MailFolder::TYPE_FOLDER) { + if ($folderType !== MailFolder::TYPE_FOLDER) { $systemFolderTypes[] = $folderType; } @@ -140,9 +121,7 @@ public function listToTree( $mailFolderChildList = new MailFolderChildList(); foreach ($folders as $parentKey => $mailFolders) { - $mailFolders = in_array("folderType", $fields) - ? $this->sortMailFolders($mailFolders) - : $mailFolders; + $mailFolders = $this->sortMailFolders($mailFolders); $tmp = $this->getMailFolderWithId($parentKey, $folders); foreach ($mailFolders as $item) { @@ -170,7 +149,7 @@ public function listToTree( /** * Sorts the mailfolders given their type, if available, and will - * place INBOX, DRAFT, JUNK, SENT and TRASH folders at the first + * place INBOX, DRAFT, JUNK, SENT and TRASH folders at the firs * indexes, in this order. * * @param $mailFolders @@ -188,7 +167,7 @@ private function sortMailFolders($mailFolders) return $found; }; - return array_merge( + $mailFolders = array_merge( $findType([MailFolder::TYPE_INBOX]), $findType([MailFolder::TYPE_DRAFT]), $findType([MailFolder::TYPE_JUNK]), @@ -196,6 +175,8 @@ private function sortMailFolders($mailFolders) $findType([MailFolder::TYPE_TRASH]), $findType([MailFolder::TYPE_FOLDER]) ); + + return $mailFolders; } /** @@ -229,108 +210,32 @@ private function getMailFolderWithId(string $id, array $folders): ?MailFolder * * @param ListMailFolder $listMailFolder * @param array $root - * @param bool $includeChildNodes if set to false, the mail folder will be skipped if - * it is not in the list of root folders * * @return boolean */ - protected function shouldSkipMailFolder(ListMailFolder $listMailFolder, array $root, bool $includeChildNodes = true): bool + protected function shouldSkipMailFolder(ListMailFolder $listMailFolder, array $root): bool { - $delim = $listMailFolder->getDelimiter(); $id = $listMailFolder->getFolderKey()->getId(); - $idParts = explode($delim, $id); - $depthChild = count($idParts); - if (!count($root) && !$includeChildNodes && $depthChild > 1) { - return true; - } + $idParts = explode($listMailFolder->getDelimiter(), $id); - foreach ($root as $globalId) { - // the id of the folder is not found in the globalId, skip - // id: JUNK.Drafts globalId: INBOX" - if (stripos($id, $globalId) === false) { - return true; + if (count($root)) { + $skip = 0; + foreach ($root as $globalIds) { + $rootParts = explode($listMailFolder->getDelimiter(), $globalIds); + foreach ($rootParts as $key => $rootId) { + if (!isset($idParts[$key]) || $rootId !== $idParts[$key]) { + $skip++; + } + } } - - $depthRoot = count(explode($delim, $globalId)); - // id is part of globalId - if no childNodes should be returned, skip - // this one. - if (!$includeChildNodes && $depthRoot < $depthChild) { + if ($skip === count($root)) { return true; } } - return in_array("\\noselect", $listMailFolder->getAttributes()) || in_array("\\nonexistent", $listMailFolder->getAttributes()); } - - - - /** - * Assembles the name representative for the specified mailfolder out of its id. - * - * @param ListMailFolder $mailFolder - * - * @return string - */ - protected function buildName(ListMailFolder $mailFolder): string - { - $nameParts = explode($mailFolder->getDelimiter(), $mailFolder->getName()); - return array_pop($nameParts); - } - - - /** - * Return sthe folder type for the specified $mailFolder. - * If the folder type was already registered in $systemFolderTypes, MailFolder::TYPE_FOLDER is used. - * - * @param ListMailFolder $mailFolder - * @param array $systemFolderTypes - * - * @return string - * - * @see getFolderIdToTypeMapper() - */ - protected function buildFolderType(ListMailFolder $mailFolder, array $systemFolderTypes): string - { - $folderType = $this->getFolderIdToTypeMapper()->getFolderType($mailFolder); - if (in_array($folderType, $systemFolderTypes)) { - $folderType = MailFolder::TYPE_FOLDER; - } - - return $folderType; - } - - - /** - * Returns the value for the field anme, unreadMessages or totalMessages. - * - * @param ListMailFolder $mailFolder - * @param string $field - * - * @return mixed - */ - protected function getValueForField(ListMailFolder $mailFolder, string $field): mixed - { - $fields = ["name", "unreadMessages", "totalMessages"]; - - if (!in_array($field, $fields)) { - throw new InvalidArgumentException( - "\"$field\" must be one of " . implode(", ", $fields) - ); - } - - if (!$this->valueCallbacks) { - $this->valueCallbacks = [ - "name" => fn($mailFolder) => $this->buildName($mailFolder), - "unreadMessages" => fn($mailFolder) => $mailFolder->getUnreadMessages(), - "totalMessages" => fn($mailFolder) => $mailFolder->getTotalMessages() - ]; - } - - - return $this->valueCallbacks[$field]($mailFolder); - } } diff --git a/src/MailClient/Folder/Tree/MailFolderTreeBuilder.php b/src/Mail/Client/Folder/Tree/MailFolderTreeBuilder.php similarity index 81% rename from src/MailClient/Folder/Tree/MailFolderTreeBuilder.php rename to src/Mail/Client/Folder/Tree/MailFolderTreeBuilder.php index 41a98bdc..d89a6236 100644 --- a/src/MailClient/Folder/Tree/MailFolderTreeBuilder.php +++ b/src/Mail/Client/Folder/Tree/MailFolderTreeBuilder.php @@ -27,17 +27,16 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Folder\Tree; +namespace Conjoon\Mail\Client\Folder\Tree; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; -use Conjoon\MailClient\Folder\MailFolderChildList; -use Conjoon\MailClient\Folder\MailFolderList; +use Conjoon\Mail\Client\Folder\MailFolderChildList; +use Conjoon\Mail\Client\Folder\MailFolderList; /** * Interface MailFolderTreeBuilder. * * - * @package Conjoon\MailClient\Folder\Tree + * @package Conjoon\Mail\Client\Folder\Tree */ interface MailFolderTreeBuilder { @@ -46,14 +45,12 @@ interface MailFolderTreeBuilder * a tree structure representing this list. The tree structure does not necessarily start * with a root folder and allows for returning a MailFolderChildList which can either hold * one entry (representing the root) or multiple entries. - * The $query may provide information about which fields to return with the MailFolders. * * @param MailFolderList $mailFolderList * @param array $root One or more global ids of the folders that should be used as the root folders. * For most IMAP installations, this will be ["INBOX"]. - * @param MailFolderListQuery $query * * @return MailFolderChildList */ - public function listToTree(MailFolderList $mailFolderList, array $root, MailFolderListQuery $query): MailFolderChildList; + public function listToTree(MailFolderList $mailFolderList, array $root): MailFolderChildList; } diff --git a/src/MailClient/Data/Protocol/Imap/ImapClientException.php b/src/Mail/Client/Imap/ImapClientException.php similarity index 93% rename from src/MailClient/Data/Protocol/Imap/ImapClientException.php rename to src/Mail/Client/Imap/ImapClientException.php index 4e6c98eb..8367f61a 100644 --- a/src/MailClient/Data/Protocol/Imap/ImapClientException.php +++ b/src/Mail/Client/Imap/ImapClientException.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Imap; +namespace Conjoon\Mail\Client\Imap; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\MailClientException; /** * Class MailClientException diff --git a/src/MailClient/Data/Protocol/Imap/Util/DefaultFolderIdToTypeMapper.php b/src/Mail/Client/Imap/Util/DefaultFolderIdToTypeMapper.php similarity index 88% rename from src/MailClient/Data/Protocol/Imap/Util/DefaultFolderIdToTypeMapper.php rename to src/Mail/Client/Imap/Util/DefaultFolderIdToTypeMapper.php index fda4c06c..f93edb4d 100644 --- a/src/MailClient/Data/Protocol/Imap/Util/DefaultFolderIdToTypeMapper.php +++ b/src/Mail/Client/Imap/Util/DefaultFolderIdToTypeMapper.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Imap\Util; +namespace Conjoon\Mail\Client\Imap\Util; -use Conjoon\MailClient\Folder\FolderIdToTypeMapper; -use Conjoon\MailClient\Folder\ListMailFolder; -use Conjoon\MailClient\Folder\MailFolder; +use Conjoon\Mail\Client\Folder\FolderIdToTypeMapper; +use Conjoon\Mail\Client\Folder\ListMailFolder; +use Conjoon\Mail\Client\Folder\MailFolder; /** * Class DefaultFolderIdToTypeMapper. * Default implementation of a FolderIdToTypeMapper. * - * @package Conjoon\MailClient\Data\Protocol\Imap\Util + * @package Conjoon\Mail\Client\Imap\Util */ class DefaultFolderIdToTypeMapper implements FolderIdToTypeMapper { @@ -57,30 +57,26 @@ class DefaultFolderIdToTypeMapper implements FolderIdToTypeMapper * * $listMailFolder = new ListMailFolder(new FolderKey("dev", "INBOX"), * ["name" => "INBOX", - * "delimiter" => ".", - * "totalMessages" => 100, - * "unreadMessages" => 4]); + * "delimiter" => "." + * "unreadCount" => 4]); * $this->getFolderType($listMailFolder); // returns "INBOX" * * $listMailFolder = new ListMailFolder(new FolderKey("dev", "INBOX.SomeFolder.Deep.Drafts"), * ["name" => "Drafts", - * "delimiter" => ".", - * "totalMessages" => 100, - * "unreadMessages" => 4]); + * "delimiter" => "." + * "unreadCount" => 4]); * $this->getFolderType($listMailFolder); // returns "FOLDER" * * $listMailFolder = new ListMailFolder(new FolderKey("dev", "INBOX.Drafts"), * ["name" => "Drafts", - * "delimiter" => ".", - * "totalMessages" => 100, - * "unreadMessages" => 4]); + * "delimiter" => "." + * "unreadCount" => 4]); * $this->getFolderType($listMailFolder); // returns "DRAFT" * * $listMailFolder = new ListMailFolder(new FolderKey("dev", "INBOX.Trash.Deep.Deeper.Folder"), * ["name" => "Folder", - * "delimiter" => ".", - * "totalMessages" => 100, - * "unreadMessages" => 4]); + * "delimiter" => "." + * "unreadCount" => 4]); * $this->getFolderType($listMailFolder); // returns "FOLDER" * * @param ListMailFolder $listMailFolder diff --git a/src/MailClient/MailClient.php b/src/Mail/Client/MailClient.php similarity index 71% rename from src/MailClient/MailClient.php rename to src/Mail/Client/MailClient.php index 56f0c5a9..720b42fd 100644 --- a/src/MailClient/MailClient.php +++ b/src/Mail/Client/MailClient.php @@ -27,30 +27,26 @@ declare(strict_types=1); -namespace Conjoon\MailClient; - -use Conjoon\MailClient\Message\Attachment\FileAttachmentItemList; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Exception\MailFolderNotFoundException; -use Conjoon\MailClient\Folder\MailFolderList; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Data\Resource\Query\MessageItemListQuery; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; +namespace Conjoon\Mail\Client; + +use Conjoon\Mail\Client\Attachment\FileAttachmentItemList; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Folder\MailFolderList; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; /** * Interface MailClient - * @package Conjoon\MailClient + * @package Conjoon\Mail\Client */ interface MailClient { @@ -59,28 +55,24 @@ interface MailClient * mailboxes available for the specified MailAccount. * * @param MailAccount $mailAccount - * @param MailFolderListQuery $query An additional set of options for querying the - * MailFolderList. * * @return MailFolderList * * @throws MailClientException if any exception occurs */ - public function getMailFolderList(MailAccount $mailAccount, MailFolderListQuery $query): MailFolderList; + public function getMailFolderList(MailAccount $mailAccount): MailFolderList; /** * Returns the specified MessageItem for the submitted arguments. * * @param MessageKey $messageKey - * @param MessageItemQuery $query An additional set of options for querying the - * MessageItem * * @return MessageItem|null The MessageItem or null if none found. * * @throws MailClientException if any exception occurs */ - public function getMessageItem(MessageKey $messageKey, MessageItemQuery $query): ?MessageItem; + public function getMessageItem(MessageKey $messageKey): ?MessageItem; /** @@ -99,14 +91,12 @@ public function deleteMessage(MessageKey $messageKey): bool; * Returns the specified MessageItemDraft for the submitted arguments. * * @param MessageKey $messageKey - * @param MessageItemQuery $query An additional set of options for querying the - * MessageItemDraft * * @return MessageItemDraft|null The MessageItemDraft or null if none found. * * @throws MailClientException if any exception occurs */ - public function getMessageItemDraft(MessageKey $messageKey, MessageItemQuery $query): ?MessageItemDraft; + public function getMessageItemDraft(MessageKey $messageKey): ?MessageItemDraft; /** @@ -126,28 +116,13 @@ public function sendMessageDraft(MessageKey $messageKey): bool; * * @param MessageKey $messageKey * - * @return MessageBody|null The MessageBody or null if none found. + * @return MessageBody The MessageBody or null if none found. * * @throws MailClientException if any exception occurs */ public function getMessageBody(MessageKey $messageKey): ?MessageBody; - /** - * Appends a new Message to the specified Folder with the data found in MessageItemDraft. - * Will mark the newly created Message as a draft. - * - * @param FolderKey $folderKey - * @param MessageItemDraft $messageItemDraft - * - * @return MessageItemDraft the created MessageItemDraft - * - * @throws MailClientException if any exception occurs, or of the MessageItemDraft already has - * a MessageKey - */ - public function createMessageDraft(FolderKey $folderKey, MessageItemDraft $messageItemDraft): MessageItemDraft; - - /** * Appends a new Message to the specified Folder with the data found in MessageBodyDraft. * Will mark the newly created Message as a draft. @@ -181,7 +156,7 @@ public function updateMessageBodyDraft(MessageBodyDraft $messageBodyDraft): Mess * * @param MessageItemDraft $messageItemDraft * - * @return MessageItemDraft|null The MessageItemDraft updated, along with its MessageKey, which + * @return MessageItemDraft The MessageItemDraft updated, along with its MessageKey, which * might not equal to the MessageKey in $messageItemDraft. * * @throws MailClientException if any exception occurs @@ -193,29 +168,42 @@ public function updateMessageDraft(MessageItemDraft $messageItemDraft): ?Message * Returns the specified MessageList for the submitted arguments. * * @param FolderKey $folderKey - * @param MessageItemListQuery $query An additional set of options for querying the - * MessageList. + * @param MessageItemListResourceQuery $query An additional set of options for querying the + * MessageList, such as sort-direction, start/limit values and the ids of the messageItems to return. + * Options may include an "attributes" configuration specifying the attributes of a message + * that should be queried and returned, wheres the keys of this array are the attributes, and the + * values are further configuration options this client may implement. Clients need to return a + * set of attributes if no attributes are defined. See #getDefaultAttributes * * @return MessageItemList * - * @throws MailFolderNotFoundException|MailClientException if the specified - * MailFolder was not found, or an exception thrown by the implementing API wrapped in a MailClientException + * @throws MailClientException if any exception occurs */ - public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $query): MessageItemList; + public function getMessageItemList(FolderKey $folderKey, MessageItemListResourceQuery $query): MessageItemList; /** - * Returns ab array keyed with "unreadMessages" and "totalMessages", - * set to the number ot unread messages and the number of messages available in the - * specified mailbox. + * Returns the total number of messages in the specified $mailFolderId for the specified $account; * * @param FolderKey $folderKey * - * @return array + * @return int + * + * @throws MailClientException if any exception occurs + */ + public function getTotalMessageCount(FolderKey $folderKey): int; + + + /** + * Returns the total number of UNREAD messages in the specified $mailFolderId for the specified $account; + * + * @param FolderKey $folderKey + * + * @return int * * @throws MailClientException if any exception occurs */ - public function getMessageCount(FolderKey $folderKey): array; + public function getUnreadMessageCount(FolderKey $folderKey): int; /** @@ -224,7 +212,7 @@ public function getMessageCount(FolderKey $folderKey): array; * @param MessageKey $messageKey * @param FileAttachmentList $attachmentList * - * @return FileAttachmentList the created FileAttachmentItemList + * @return FileAttachmentItemList the created FileAttachmentItemList * * @throws MailClientException if any exception occurs */ @@ -287,4 +275,21 @@ public function setFlags(MessageKey $messageKey, FlagList $flagList): bool; * not the same, or if any other error occurs */ public function moveMessage(MessageKey $messageKey, FolderKey $folderKey): MessageKey; + + + /** + * Returns an array with the attribute-names the client supports. + * + * @return array + */ + public function getSupportedAttributes(): array; + + + /** + * Returns an array with the attributes the client guarantees to query if no attributes + * where specified for methods that require them. + * + * @return array + */ + public function getDefaultAttributes(): array; } diff --git a/src/MailClient/Exception/MailClientException.php b/src/Mail/Client/MailClientException.php similarity index 94% rename from src/MailClient/Exception/MailClientException.php rename to src/Mail/Client/MailClientException.php index 2b2a10f8..8c5559ff 100644 --- a/src/MailClient/Exception/MailClientException.php +++ b/src/Mail/Client/MailClientException.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Exception; +namespace Conjoon\Mail\Client; use RuntimeException; /** * Class MailClientException * - * @package Conjoon\MailClient\Exception + * @package Conjoon\Mail\Client */ class MailClientException extends RuntimeException { diff --git a/src/MailClient/Message/AbstractMessageBody.php b/src/Mail/Client/Message/AbstractMessageBody.php similarity index 84% rename from src/MailClient/Message/AbstractMessageBody.php rename to src/Mail/Client/Message/AbstractMessageBody.php index 22e86df7..ecb51af2 100644 --- a/src/MailClient/Message/AbstractMessageBody.php +++ b/src/Mail/Client/Message/AbstractMessageBody.php @@ -27,20 +27,19 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; /** * Class AbstractMessageBody models a simplified representation of mail message * body-contents. * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message */ -abstract class AbstractMessageBody implements Arrayable, Jsonable +abstract class AbstractMessageBody implements Jsonable { /** * @var MessagePart|null @@ -127,7 +126,7 @@ public function getTextPlain(): ?MessagePart // -------------------------------- -// Arrayable interface +// Jsonable interface // -------------------------------- /** @@ -145,27 +144,14 @@ public function getTextPlain(): ?MessagePart * @return array * */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { - $key = $this->getMessageKey() ? $this->getMessageKey()->toArray() : null; - return array_merge($key ?? [], [ - "type" => "MessageBody", + $keyJson = $this->getMessageKey() ? $this->getMessageKey()->toJson() : null; + + return array_merge($keyJson ?? [], [ "textHtml" => $this->getTextHtml() ? $this->getTextHtml()->getContents() : "", "textPlain" => $this->getTextPlain() ? $this->getTextPlain()->getContents() : "" ]); } - - -// -------------------------------- -// Jsonable interface -// -------------------------------- - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - return $strategy ? $strategy->toJson($this) : $this->toArray(); - } } diff --git a/src/MailClient/Message/AbstractMessageItem.php b/src/Mail/Client/Message/AbstractMessageItem.php similarity index 84% rename from src/MailClient/Message/AbstractMessageItem.php rename to src/Mail/Client/Message/AbstractMessageItem.php index 7be20693..11a9bdf1 100644 --- a/src/MailClient/Message/AbstractMessageItem.php +++ b/src/Mail/Client/Message/AbstractMessageItem.php @@ -27,22 +27,21 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; use BadMethodCallException; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Message\Flag\DraftFlag; -use Conjoon\MailClient\Message\Flag\FlaggedFlag; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\Flag\SeenFlag; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\Data\Modifiable; -use Conjoon\Data\ModifiableTrait; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Mail\Client\Message\Flag\DraftFlag; +use Conjoon\Mail\Client\Message\Flag\FlaggedFlag; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\Flag\SeenFlag; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; +use Conjoon\Util\Modifiable; +use Conjoon\Util\ModifiableTrait; use DateTime; use TypeError; @@ -60,7 +59,7 @@ * $item->setSubject("Foo"); * $item->getSubject(); // "Foo" * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message * @method setSubject(string $convert) * @method getSubject() * @method getCharset() @@ -79,14 +78,14 @@ * @method getReferences() * @method getInReplyTo() */ -abstract class AbstractMessageItem implements Arrayable, Jsonable, Modifiable +abstract class AbstractMessageItem implements Jsonable, Modifiable { use ModifiableTrait; /** * @var MessageKey */ - protected ?MessageKey $messageKey = null; + protected MessageKey $messageKey; /** * @var MailAddress|null @@ -169,36 +168,22 @@ public static function isHeaderField($field): bool /** - * Allows for passing only the data for the AbstractMessageItemDraft w/o a MessageKey. + * MessageItem constructor. * - * - * @param MessageKey|array|null $messageKey + * @param MessageKey $messageKey * @param array|null $data + * + * */ - public function __construct($messageKey = null, $data = null) + public function __construct(MessageKey $messageKey, array $data = null) { - if (is_array($messageKey)) { - $data = $messageKey; - $messageKey = null; - } - if ($messageKey instanceof MessageKey) { - $this->messageKey = $messageKey; - } + $this->messageKey = $messageKey; - if (is_array($data)) { - $this->configure($data); + if (!$data) { + return; } - } - - /** - * Configures an instance of this class with the passed data. - * - * @param array $data - */ - protected function configure(array $data) - { $this->suspendModifiable(); foreach ($data as $key => $value) { if (property_exists($this, $key)) { @@ -423,19 +408,6 @@ protected function checkType(string $property, $value) // -------------------------------- // Jsonable interface -// -------------------------------- - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - return $strategy ? $strategy->toJson($this) : $this->toArray(); - } - - -// -------------------------------- -// Arrayable interface // -------------------------------- /** @@ -443,13 +415,13 @@ public function toJson(JsonStrategy $strategy = null): array * * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { $mk = $this->getMessageKey(); - $data = array_merge($mk ? $mk->toArray() : [], [ - 'from' => $this->getFrom() ? $this->getFrom()->toArray() : null, - 'to' => $this->getTo() ? $this->getTo()->toArray() : null, + $data = array_merge($mk->toJson(), [ + 'from' => $this->getFrom() ? $this->getFrom()->toJson() : null, + 'to' => $this->getTo() ? $this->getTo()->toJson() : null, 'subject' => $this->getSubject(), 'date' => $this->getDate() ? $this->getDate()->format("Y-m-d H:i:s O") : null, 'seen' => $this->getSeen(), @@ -461,7 +433,7 @@ public function toArray(): array 'references' => $this->getReferences(), ]); - return $this->buildArray($data); + return $this->buildJson($data); } @@ -471,7 +443,7 @@ public function toArray(): array * @param array $thisData * @return array */ - protected function buildArray(array $thisData): array + protected function buildJson(array $thisData): array { $thisData = array_filter( $thisData, diff --git a/src/MailClient/Message/Composer/AttachmentComposer.php b/src/Mail/Client/Message/Composer/AttachmentComposer.php similarity index 91% rename from src/MailClient/Message/Composer/AttachmentComposer.php rename to src/Mail/Client/Message/Composer/AttachmentComposer.php index ec432d02..75c30a95 100644 --- a/src/MailClient/Message/Composer/AttachmentComposer.php +++ b/src/Mail/Client/Message/Composer/AttachmentComposer.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Composer; +namespace Conjoon\Mail\Client\Message\Composer; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; /** * Interface AttachmentComposer @@ -37,7 +37,7 @@ * Contract for composing attachments for a raw message. * * - * @package Conjoon\MailClient\Message\Composer + * @package Conjoon\Mail\Client\Message\Composer */ interface AttachmentComposer { diff --git a/src/MailClient/Message/Composer/BodyComposer.php b/src/Mail/Client/Message/Composer/BodyComposer.php similarity index 93% rename from src/MailClient/Message/Composer/BodyComposer.php rename to src/Mail/Client/Message/Composer/BodyComposer.php index a9ea7426..af0786a6 100644 --- a/src/MailClient/Message/Composer/BodyComposer.php +++ b/src/Mail/Client/Message/Composer/BodyComposer.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Composer; +namespace Conjoon\Mail\Client\Message\Composer; -use Conjoon\MailClient\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageBodyDraft; /** * Interface BodyComposer @@ -37,7 +37,7 @@ * Contract for transforming a MessageBodyDraft to a full text email message. * * - * @package Conjoon\MailClient\Message\Composer + * @package Conjoon\Mail\Client\Message\Composer */ interface BodyComposer { diff --git a/src/MailClient/Message/Composer/HeaderComposer.php b/src/Mail/Client/Message/Composer/HeaderComposer.php similarity index 93% rename from src/MailClient/Message/Composer/HeaderComposer.php rename to src/Mail/Client/Message/Composer/HeaderComposer.php index 4b1f310c..a03ea13a 100644 --- a/src/MailClient/Message/Composer/HeaderComposer.php +++ b/src/Mail/Client/Message/Composer/HeaderComposer.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Composer; +namespace Conjoon\Mail\Client\Message\Composer; -use Conjoon\MailClient\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemDraft; /** * Interface HeaderComposer * - * @package Conjoon\MailClient\Message\Composer + * @package Conjoon\Mail\Client\Message\Composer */ interface HeaderComposer { diff --git a/src/MailClient/Message/Composer/README.md b/src/Mail/Client/Message/Composer/README.md similarity index 76% rename from src/MailClient/Message/Composer/README.md rename to src/Mail/Client/Message/Composer/README.md index c0d1b58f..9f0a46e0 100644 --- a/src/MailClient/Message/Composer/README.md +++ b/src/Mail/Client/Message/Composer/README.md @@ -1,4 +1,4 @@ -# Conjoon\MailClient\Message\Composer +# Conjoon\Mail\Client\Message\Composer This package provides contracts for transforming `MessageBodyDraft` and `MessageItemDraft` into RFC compliant MIME messages. diff --git a/src/MailClient/Message/DraftTrait.php b/src/Mail/Client/Message/DraftTrait.php similarity index 96% rename from src/MailClient/Message/DraftTrait.php rename to src/Mail/Client/Message/DraftTrait.php index f027c7c6..7e9a1645 100644 --- a/src/MailClient/Message/DraftTrait.php +++ b/src/Mail/Client/Message/DraftTrait.php @@ -27,10 +27,10 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; /** * Helper-Trait for defining draft-related information. diff --git a/src/MailClient/Message/Flag/AbstractFlag.php b/src/Mail/Client/Message/Flag/AbstractFlag.php similarity index 95% rename from src/MailClient/Message/Flag/AbstractFlag.php rename to src/Mail/Client/Message/Flag/AbstractFlag.php index 69d5be4c..1d462dd6 100644 --- a/src/MailClient/Message/Flag/AbstractFlag.php +++ b/src/Mail/Client/Message/Flag/AbstractFlag.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Flag; +namespace Conjoon\Mail\Client\Message\Flag; /** * Base class for Message Flags * * - * @package Conjoon\MailClient\Message\Flag + * @package Conjoon\Mail\Client\Message\Flag */ abstract class AbstractFlag { diff --git a/src/MailClient/Message/Flag/AnsweredFlag.php b/src/Mail/Client/Message/Flag/AnsweredFlag.php similarity index 94% rename from src/MailClient/Message/Flag/AnsweredFlag.php rename to src/Mail/Client/Message/Flag/AnsweredFlag.php index 07d3d5a0..e4bb2e4b 100644 --- a/src/MailClient/Message/Flag/AnsweredFlag.php +++ b/src/Mail/Client/Message/Flag/AnsweredFlag.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Flag; +namespace Conjoon\Mail\Client\Message\Flag; /** * Class representing \Answered-Flag * * - * @package Conjoon\MailClient\Message\Flag + * @package Conjoon\Mail\Client\Message\Flag */ final class AnsweredFlag extends AbstractFlag { diff --git a/src/MailClient/Message/Flag/DraftFlag.php b/src/Mail/Client/Message/Flag/DraftFlag.php similarity index 94% rename from src/MailClient/Message/Flag/DraftFlag.php rename to src/Mail/Client/Message/Flag/DraftFlag.php index ed1a2e86..eb2b9e62 100644 --- a/src/MailClient/Message/Flag/DraftFlag.php +++ b/src/Mail/Client/Message/Flag/DraftFlag.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Flag; +namespace Conjoon\Mail\Client\Message\Flag; /** * Class representing \Draft-Flag * * - * @package Conjoon\MailClient\Message\Flag + * @package Conjoon\Mail\Client\Message\Flag */ final class DraftFlag extends AbstractFlag { diff --git a/src/MailClient/Message/Flag/FlagList.php b/src/Mail/Client/Message/Flag/FlagList.php similarity index 94% rename from src/MailClient/Message/Flag/FlagList.php rename to src/Mail/Client/Message/Flag/FlagList.php index 25f0c332..d363468a 100644 --- a/src/MailClient/Message/Flag/FlagList.php +++ b/src/Mail/Client/Message/Flag/FlagList.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Flag; +namespace Conjoon\Mail\Client\Message\Flag; -use Conjoon\Core\AbstractList; +use Conjoon\Util\AbstractList; /** * Class FlagList manages a list of flags. * * - * @package Conjoon\MailClient\Message\Flag + * @package Conjoon\Mail\Client\Message\Flag */ class FlagList extends AbstractList { diff --git a/src/MailClient/Message/Flag/FlaggedFlag.php b/src/Mail/Client/Message/Flag/FlaggedFlag.php similarity index 94% rename from src/MailClient/Message/Flag/FlaggedFlag.php rename to src/Mail/Client/Message/Flag/FlaggedFlag.php index 95e255e1..d60709fe 100644 --- a/src/MailClient/Message/Flag/FlaggedFlag.php +++ b/src/Mail/Client/Message/Flag/FlaggedFlag.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Flag; +namespace Conjoon\Mail\Client\Message\Flag; /** * Class representing \Flagged-Flag * * - * @package Conjoon\MailClient\Message\Flag + * @package Conjoon\Mail\Client\Message\Flag */ final class FlaggedFlag extends AbstractFlag { diff --git a/src/MailClient/Message/Flag/SeenFlag.php b/src/Mail/Client/Message/Flag/SeenFlag.php similarity index 94% rename from src/MailClient/Message/Flag/SeenFlag.php rename to src/Mail/Client/Message/Flag/SeenFlag.php index 481293cb..2e031c93 100644 --- a/src/MailClient/Message/Flag/SeenFlag.php +++ b/src/Mail/Client/Message/Flag/SeenFlag.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Flag; +namespace Conjoon\Mail\Client\Message\Flag; /** * Class representing \Seen-Flag * * - * @package Conjoon\MailClient\Message\Flag + * @package Conjoon\Mail\Client\Message\Flag */ final class SeenFlag extends AbstractFlag { diff --git a/src/Mail/Client/Message/ListMessageItem.php b/src/Mail/Client/Message/ListMessageItem.php new file mode 100644 index 00000000..ed0b00b7 --- /dev/null +++ b/src/Mail/Client/Message/ListMessageItem.php @@ -0,0 +1,136 @@ + new \DateTime()], + * $mp + * ); + * + * $item->getMessageKey(); + * $item->setSubject("Foo"); + * $item->getSubject(); // "Foo" + * $item->getMessagePart(); // instance of MessagePart + * + * #toJson will return an additional property "previewText" with the contents of the + * MessagePart. + * + * $item->toJson()["previewText"]; // outputs $mp->getContents(); + * + * + * @package Conjoon\Mail\Client\Message + */ +class ListMessageItem extends MessageItem +{ + use DraftTrait; + + /** + * @var MessagePart|null + */ + protected ?MessagePart $messagePart = null; + + /** + * ListMessageItem constructor. + * + * @param MessageKey $messageKey + * @param array|null $data + * @param MessagePart|null $messagePart + */ + public function __construct(MessageKey $messageKey, array $data = null, MessagePart $messagePart = null) + { + + parent::__construct($messageKey, $data); + + $this->messagePart = $messagePart; + } + + + /** + * Returns the MessagePart set for this ListMessageItem. + * + * @return MessagePart + */ + public function getMessagePart(): ?MessagePart + { + return $this->messagePart; + } + + /** + * Sets the MessagePart set for this ListMessageItem. + * + * @return ListMessageItem + */ + public function setMessagePart(?MessagePart $messagePart): ?ListMessageItem + { + $this->messagePart = $messagePart; + return $this; + } + + +// -------------------------------- +// Jsonable interface +// -------------------------------- + + /** + * @inheritdoc + */ + public function toJson(JsonStrategy $strategy = null): array + { + $data = parent::toJson(); + + if ($this->getMessagePart()) { + $data["previewText"] = $this->getMessagePart()->getContents(); + } + + $data = array_merge($data, [ + 'cc' => $this->getCc() ? $this->getCc()->toJson() : null, + 'bcc' => $this->getBcc() ? $this->getBcc()->toJson() : null, + 'replyTo' => $this->getReplyTo() ? $this->getReplyTo()->toJson() : null + ]); + + return $this->buildJson($data); + } +} diff --git a/src/MailClient/Message/MessageBody.php b/src/Mail/Client/Message/MessageBody.php similarity index 93% rename from src/MailClient/Message/MessageBody.php rename to src/Mail/Client/Message/MessageBody.php index a2680f7d..1b768a20 100644 --- a/src/MailClient/Message/MessageBody.php +++ b/src/Mail/Client/Message/MessageBody.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; /** * Class MessageBody. @@ -47,7 +47,7 @@ * $body->getTextPlain();// $plainPart * $body->getTextHtml(); // $htmlPart * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message */ class MessageBody extends AbstractMessageBody { diff --git a/src/MailClient/Message/MessageBodyDraft.php b/src/Mail/Client/Message/MessageBodyDraft.php similarity index 94% rename from src/MailClient/Message/MessageBodyDraft.php rename to src/Mail/Client/Message/MessageBodyDraft.php index d5bc89cc..d204e20e 100644 --- a/src/MailClient/Message/MessageBodyDraft.php +++ b/src/Mail/Client/Message/MessageBodyDraft.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; /** * Class MessageBodyDraft represents a draft of a MessageBody, that may have a MessageKey @@ -46,7 +46,7 @@ * * $keyedDraft !== $body; // true * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message */ class MessageBodyDraft extends AbstractMessageBody { diff --git a/src/MailClient/Message/MessageItem.php b/src/Mail/Client/Message/MessageItem.php similarity index 75% rename from src/MailClient/Message/MessageItem.php rename to src/Mail/Client/Message/MessageItem.php index 30ac0de0..ac487d23 100644 --- a/src/MailClient/Message/MessageItem.php +++ b/src/Mail/Client/Message/MessageItem.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; +use Conjoon\Util\JsonStrategy; /** * Class MessageItem models envelope information of a Message. * * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message * @method getHasAttachments() * @method getSize() */ @@ -52,27 +52,6 @@ class MessageItem extends AbstractMessageItem protected ?bool $hasAttachments = null; - /** - * MessageItem constructor. - * - * @param MessageKey $messageKey - * @param array|null $data - * - * @see configure - */ - public function __construct(MessageKey $messageKey, array $data = null) - { - - $this->messageKey = $messageKey; - - if (!$data) { - return; - } - - $this->configure($data); - } - - /** * @inheritdoc */ @@ -99,7 +78,7 @@ protected function checkType(string $property, $value) // -------------------------------- -// Arrayable interface +// Jsonable interface // -------------------------------- /** @@ -107,14 +86,13 @@ protected function checkType(string $property, $value) * Only the data will be returned where the values are not null. * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { $data = array_merge([ - "type" => "MessageItem", - "hasAttachments" => $this->getHasAttachments(), - "size" => $this->getSize() - ], parent::toArray()); + 'hasAttachments' => $this->getHasAttachments(), + 'size' => $this->getSize() + ], parent::toJson()); - return $this->buildArray($data); + return $this->buildJson($data); } } diff --git a/src/MailClient/Message/MessageItemDraft.php b/src/Mail/Client/Message/MessageItemDraft.php similarity index 72% rename from src/MailClient/Message/MessageItemDraft.php rename to src/Mail/Client/Message/MessageItemDraft.php index cefb1ae3..5d3eec69 100644 --- a/src/MailClient/Message/MessageItemDraft.php +++ b/src/Mail/Client/Message/MessageItemDraft.php @@ -27,24 +27,23 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Util\JsonStrategy; /** * Class MessageItemDraft models envelope information of a Message Draft. * A MessageDraft that was stored and exists physically provides also a MessageKey. * - * A message draft may actually be in "draft" state, i.e. physically not existing by omitting - * the MessageKey when creating an instance. Once a MessageDraft is about to get saved, setMessageKey - * can be used for creating the compound key for the draft. - * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message * @method getReplyTo() * @method getBcc() * @method getCc() - * @method getDraftInfo() + * @method getXCnDraftInfo() */ class MessageItemDraft extends AbstractMessageItem { @@ -53,7 +52,7 @@ class MessageItemDraft extends AbstractMessageItem /** * A json encoded array, encoded as a base64-string, containing information about the - * mailAccountId, the mailFolderId and the messageItemId this draft references, + * mailAccountId, the mailFolderId and the messageItemId this draft references), * in this order. * This value will be set by the client once a draft gets saved that is created * for a reply-to/-all regarding a message, and will be reused once the draft @@ -62,23 +61,18 @@ class MessageItemDraft extends AbstractMessageItem * * @var string|null */ - protected ?string $draftInfo = null; + protected ?string $xCnDraftInfo = null; /** - * Allows for passing only the data for the AbstractMessageItemDraft w/o a MessageKey. - * - * - * @param MessageKey|array|null $messageKey - * @param array|null $data + * @inheritdoc */ - public function __construct($messageKey = null, $data = null) + public function __construct(MessageKey $messageKey, array $data = null) { $this->draft = true; parent::__construct($messageKey, $data); } - /** * Sets the "messageKey" by creating a new MessageItemDraft with the specified * key and returning a new instance with this data. @@ -124,40 +118,40 @@ public function setMessageKey(MessageKey $messageKey): MessageItemDraft /** - * Sets the $draftInfo for this MessageItemDraft and throws if + * Sets the xCnDraftInfo for this MessageItemDraft and throws if * the value was already set. * - * @param string|null $draftInfo + * @param string|null $xCnDraftInfo * @return $this */ - public function setDraftInfo(string $draftInfo = null): MessageItemDraft + public function setXCnDraftInfo(string $xCnDraftInfo = null): MessageItemDraft { - if (is_string($this->getDraftInfo())) { - throw new MailClientException("\"draftInfo\" was already set."); + if (is_string($this->getXCnDraftInfo())) { + throw new MailClientException("\"xCnDraftInfo\" was already set."); } - $this->draftInfo = $draftInfo; + $this->xCnDraftInfo = $xCnDraftInfo; return $this; } // -------------------------------- -// Arrayable interface +// Jsonable interface // -------------------------------- /** * @inheritdoc */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { - $data = array_merge(parent::toArray(), [ - 'cc' => $this->getCc() ? $this->getCc()->toArray() : null, - 'bcc' => $this->getBcc() ? $this->getBcc()->toArray() : null, - 'replyTo' => $this->getReplyTo() ? $this->getReplyTo()->toArray() : null + $data = array_merge(parent::toJson(), [ + 'cc' => $this->getCc() ? $this->getCc()->toJson() : null, + 'bcc' => $this->getBcc() ? $this->getBcc()->toJson() : null, + 'replyTo' => $this->getReplyTo() ? $this->getReplyTo()->toJson() : null ]); - return $this->buildArray($data); + return $this->buildJson($data); } } diff --git a/src/MailClient/Message/MessageItemList.php b/src/Mail/Client/Message/MessageItemList.php similarity index 68% rename from src/MailClient/Message/MessageItemList.php rename to src/Mail/Client/Message/MessageItemList.php index b343a152..2aaa9e48 100644 --- a/src/MailClient/Message/MessageItemList.php +++ b/src/Mail/Client/Message/MessageItemList.php @@ -27,30 +27,29 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; /** - * Class MessageItemList organizes a list of MessageItems. + * Class MessageItemList organizes a list of ListMessageItems. * * @example * * $list = new MessageItemList(); * - * $item = new MessageItem(new MessageKey("INBOX", "232"), null); + * $item = new ListMessageItem(new MessageKey("INBOX", "232"), null, new MessagePart("foo", "UTF-8", "text/plain)); * $list[] = $item; * * foreach ($list as $key => $mItem) { * // iterating over the item * } * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message */ -class MessageItemList extends AbstractList implements Arrayable, Jsonable +class MessageItemList extends AbstractList implements Jsonable { // ------------------------- // AbstractList @@ -61,50 +60,31 @@ class MessageItemList extends AbstractList implements Arrayable, Jsonable */ public function getEntityType(): string { - return MessageItem::class; + return ListMessageItem::class; } - // -------------------------------- -// Arrayable interface +// Jsonable interface // -------------------------------- /** * Returns an array representing this MessageItemList. * - * Each entry in the returning array holds an array representation of + * Each entry in the returning array holds a JSON representation of * a MessageItem. * * @return array */ - public function toArray(): array + public function toJson(JsonStrategy $strategy = null): array { + $data = []; foreach ($this->data as $messageItem) { - $data[] = $messageItem->toArray(); + $data[] = $messageItem->toJson(); } return $data; } - -// -------------------------------- -// Jsonable interface -// -------------------------------- - - /** - * Returns an array representing this MessageItemList. - * - * Each entry in the returning array holds a JSON representation of - * a MessageItem. - * - * @param JsonStrategy|null $strategy - * - * @return array - */ - public function toJson(JsonStrategy $strategy = null): array - { - return $strategy ? $strategy->toJson($this) : $this->toArray(); - } } diff --git a/src/MailClient/Message/MessagePart.php b/src/Mail/Client/Message/MessagePart.php similarity index 87% rename from src/MailClient/Message/MessagePart.php rename to src/Mail/Client/Message/MessagePart.php index fc0063dc..b4348aa5 100644 --- a/src/MailClient/Message/MessagePart.php +++ b/src/Mail/Client/Message/MessagePart.php @@ -27,10 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message; +namespace Conjoon\Mail\Client\Message; -use Conjoon\Core\Contract\Copyable; -use Conjoon\Mime\MimeType; +use Conjoon\Util\Copyable; /** * Class MessagePart models a simplified representation of a Mail Message Part, @@ -38,19 +37,22 @@ * * @example * - * $part = new MessagePart("foo", "ISO-8859-1", MimeType::TEXT_PLAIN); + * $part = new MessagePart(); + * + * $body->setContents("foo"); + * $item->setCharset("ISO-8859-1"); * * $body->getContents();// "foo" * $item->getCharset(); // "ISO-8859-1" * - * @package Conjoon\MailClient\Message + * @package Conjoon\Mail\Client\Message */ class MessagePart implements Copyable { /** - * @var string + * @vr string */ - protected MimeType $mimeType; + protected string $mimeType = ""; /** * @var string @@ -68,9 +70,9 @@ class MessagePart implements Copyable * * @param string $contents * @param string $charset - * @param MimeType $mimeType + * @param string $mimeType */ - public function __construct(string $contents, string $charset, MimeType $mimeType) + public function __construct(string $contents, string $charset, string $mimeType) { $this->setContents($contents, $charset); $this->setMimeType($mimeType); @@ -131,11 +133,11 @@ public function getCharset(): string /** * Sets the "$mimeType" for this part. * - * @param MimeType $mimeType + * @param String $mimeType * * @return $this */ - protected function setMimeType(MimeType $mimeType): MessagePart + protected function setMimeType(string $mimeType): MessagePart { $this->mimeType = $mimeType; return $this; @@ -145,9 +147,9 @@ protected function setMimeType(MimeType $mimeType): MessagePart /** * Returns the $mimeType of this part. * - * @return MimeType + * @return string */ - public function getMimeType(): MimeType + public function getMimeType(): string { return $this->mimeType; } diff --git a/src/MailClient/Message/README.md b/src/Mail/Client/Message/README.md similarity index 82% rename from src/MailClient/Message/README.md rename to src/Mail/Client/Message/README.md index 7d1e6837..8a1d19aa 100644 --- a/src/MailClient/Message/README.md +++ b/src/Mail/Client/Message/README.md @@ -1,28 +1,28 @@ -# Conjoon\MailClient\Message +# Conjoon\Mail\Client\Message This package provides various entities such as `MessageItem`, `MessageItemDraft`, `MessageBody` and `MessageBodyDraft`. A client should always create a `MessageBody` first, and then update its header information. ## MessageItems -### `Conjoon\MailClient\Message\MessageItem` +### `Conjoon\Mail\Client\Message\MessageItem` This class represents simple envelope information for an Email Message. it is used for retrieving informations when listing contents of mailboxes and when message flags are updated, but never for creating an Email Message. -### `Conjoon\MailClient\Message\MessageItemDraft` +### `Conjoon\Mail\Client\Message\MessageItemDraft` This class represents envelope information for an Email Message which is requested by the client for editing or composing. This entity has always a `MessageKey`. ## MessageBodies -### `Conjoon\MailClient\Message\MessageBody` +### `Conjoon\Mail\Client\Message\MessageBody` This class represents `textHtml` and `textPlain` information of an Email Message. It is used for retrieving data when reading an Email Message. -### `Conjoon\MailClient\Message\MessageBodyDraft` +### `Conjoon\Mail\Client\Message\MessageBodyDraft` This class represents a MessageBody with a `textHtml` and `textPlain` property. This entity is used when messages are created or updated, or if messages are requested for editing. A `MessageBodyDraft` has only a `MessageKey` once it was diff --git a/src/MailClient/Message/Text/AbstractMessagePartContentProcessor.php b/src/Mail/Client/Message/Text/AbstractMessagePartContentProcessor.php similarity index 93% rename from src/MailClient/Message/Text/AbstractMessagePartContentProcessor.php rename to src/Mail/Client/Message/Text/AbstractMessagePartContentProcessor.php index cd469f40..7f2ebbd2 100644 --- a/src/MailClient/Message/Text/AbstractMessagePartContentProcessor.php +++ b/src/Mail/Client/Message/Text/AbstractMessagePartContentProcessor.php @@ -25,16 +25,15 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Message\MessagePart; +use Conjoon\Mail\Client\Message\MessagePart; use Conjoon\Text\Converter; /** * AbstractMessagePartContentProcessor. * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ abstract class AbstractMessagePartContentProcessor implements MessagePartContentProcessor { @@ -89,7 +88,7 @@ public function process(MessagePart $messagePart, string $toCharset = "UTF-8", ? $mimeType = $messagePart->getMimeType(); switch ($mimeType) { - case MimeType::TEXT_PLAIN: + case "text/plain": $messagePart->setContents($this->plainTextStrategy->process($this->converter->convert( $messagePart->getContents(), $messagePart->getCharset(), @@ -97,7 +96,7 @@ public function process(MessagePart $messagePart, string $toCharset = "UTF-8", ? )), $toCharset); break; - case MimeType::TEXT_HTML: + case "text/html": $messagePart->setContents($this->htmlTextStrategy->process($this->converter->convert( $messagePart->getContents(), $messagePart->getCharset(), diff --git a/src/MailClient/Message/Text/DefaultMessageItemFieldsProcessor.php b/src/Mail/Client/Message/Text/DefaultMessageItemFieldsProcessor.php similarity index 94% rename from src/MailClient/Message/Text/DefaultMessageItemFieldsProcessor.php rename to src/Mail/Client/Message/Text/DefaultMessageItemFieldsProcessor.php index b08b6eec..7ae57872 100644 --- a/src/MailClient/Message/Text/DefaultMessageItemFieldsProcessor.php +++ b/src/Mail/Client/Message/Text/DefaultMessageItemFieldsProcessor.php @@ -25,14 +25,14 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\AbstractMessageItem; use Conjoon\Text\Converter; /** * Class DefaultMessageItemFieldsProcessor - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ class DefaultMessageItemFieldsProcessor implements MessageItemFieldsProcessor { diff --git a/src/MailClient/Message/Text/DefaultPreviewTextProcessor.php b/src/Mail/Client/Message/Text/DefaultPreviewTextProcessor.php similarity index 93% rename from src/MailClient/Message/Text/DefaultPreviewTextProcessor.php rename to src/Mail/Client/Message/Text/DefaultPreviewTextProcessor.php index 0085cb45..74928967 100644 --- a/src/MailClient/Message/Text/DefaultPreviewTextProcessor.php +++ b/src/Mail/Client/Message/Text/DefaultPreviewTextProcessor.php @@ -25,15 +25,15 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Data\Reader\ReadableMessagePartContentProcessor; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Reader\ReadableMessagePartContentProcessor; /** * Class PreviewProcessor * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ class DefaultPreviewTextProcessor implements PreviewTextProcessor { diff --git a/src/MailClient/Message/Text/HtmlTextStrategy.php b/src/Mail/Client/Message/Text/HtmlTextStrategy.php similarity index 94% rename from src/MailClient/Message/Text/HtmlTextStrategy.php rename to src/Mail/Client/Message/Text/HtmlTextStrategy.php index c8ae2f86..e60b353e 100644 --- a/src/MailClient/Message/Text/HtmlTextStrategy.php +++ b/src/Mail/Client/Message/Text/HtmlTextStrategy.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; /** * Interface HtmlTextStrategy * * Contract for processing HTML texts. * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ interface HtmlTextStrategy { diff --git a/src/MailClient/Message/Text/MessageItemFieldsProcessor.php b/src/Mail/Client/Message/Text/MessageItemFieldsProcessor.php similarity index 92% rename from src/MailClient/Message/Text/MessageItemFieldsProcessor.php rename to src/Mail/Client/Message/Text/MessageItemFieldsProcessor.php index 3d271f25..d3f4e638 100644 --- a/src/MailClient/Message/Text/MessageItemFieldsProcessor.php +++ b/src/Mail/Client/Message/Text/MessageItemFieldsProcessor.php @@ -25,15 +25,15 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\AbstractMessageItem; /** * Interface MessageItemFieldsProcessor. * Contract for converting header fields of a MessageItem (such as "subject") to a target charset. * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ interface MessageItemFieldsProcessor { diff --git a/src/MailClient/Message/Text/MessagePartContentProcessor.php b/src/Mail/Client/Message/Text/MessagePartContentProcessor.php similarity index 93% rename from src/MailClient/Message/Text/MessagePartContentProcessor.php rename to src/Mail/Client/Message/Text/MessagePartContentProcessor.php index bfe657df..67330900 100644 --- a/src/MailClient/Message/Text/MessagePartContentProcessor.php +++ b/src/Mail/Client/Message/Text/MessagePartContentProcessor.php @@ -25,9 +25,9 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Message\MessagePart; +use Conjoon\Mail\Client\Message\MessagePart; /** * Interface MessagePartContentProcessor. @@ -35,7 +35,7 @@ * Implementing classes are free to add any additional functionality for converting the * contents to a readable version required by the client. * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ interface MessagePartContentProcessor { diff --git a/src/MailClient/Message/Text/PlainTextStrategy.php b/src/Mail/Client/Message/Text/PlainTextStrategy.php similarity index 94% rename from src/MailClient/Message/Text/PlainTextStrategy.php rename to src/Mail/Client/Message/Text/PlainTextStrategy.php index 69415599..5aca29bd 100644 --- a/src/MailClient/Message/Text/PlainTextStrategy.php +++ b/src/Mail/Client/Message/Text/PlainTextStrategy.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; /** * Interface PlainTextStrategy * * Contract for processing plain texts. * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ interface PlainTextStrategy { diff --git a/src/MailClient/Message/Text/PreviewTextProcessor.php b/src/Mail/Client/Message/Text/PreviewTextProcessor.php similarity index 93% rename from src/MailClient/Message/Text/PreviewTextProcessor.php rename to src/Mail/Client/Message/Text/PreviewTextProcessor.php index bfd97c9f..d0812a15 100644 --- a/src/MailClient/Message/Text/PreviewTextProcessor.php +++ b/src/Mail/Client/Message/Text/PreviewTextProcessor.php @@ -25,12 +25,12 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; /** * Interface PreviewProcessor * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ interface PreviewTextProcessor extends MessagePartContentProcessor { diff --git a/src/MailClient/Message/Text/ProcessorException.php b/src/Mail/Client/Message/Text/ProcessorException.php similarity index 90% rename from src/MailClient/Message/Text/ProcessorException.php rename to src/Mail/Client/Message/Text/ProcessorException.php index 651219f1..78a5b9ae 100644 --- a/src/MailClient/Message/Text/ProcessorException.php +++ b/src/Mail/Client/Message/Text/ProcessorException.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Message\Text; +namespace Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\MailClientException; /** * Class ProcessorException * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ class ProcessorException extends MailClientException { diff --git a/src/Data/Sort/SortDirection.php b/src/Mail/Client/Query/MessageItemListResourceQuery.php similarity index 81% rename from src/Data/Sort/SortDirection.php rename to src/Mail/Client/Query/MessageItemListResourceQuery.php index 393b376e..b4e7f01d 100644 --- a/src/Data/Sort/SortDirection.php +++ b/src/Mail/Client/Query/MessageItemListResourceQuery.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2019-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\Data\Sort; +namespace Conjoon\Mail\Client\Query; + +use Conjoon\Core\ResourceQuery; /** - * Represents sort order direction. + * Class MessageItemListResourceQuery + * @package Conjoon\Mail\Client\Query */ -enum SortDirection: string +class MessageItemListResourceQuery extends ResourceQuery { - case ASC = "ascending"; - - case DESC = "descending"; } diff --git a/src/MailClient/Data/Reader/DefaultPlainReadableStrategy.php b/src/Mail/Client/Reader/DefaultPlainReadableStrategy.php similarity index 94% rename from src/MailClient/Data/Reader/DefaultPlainReadableStrategy.php rename to src/Mail/Client/Reader/DefaultPlainReadableStrategy.php index 7c850f93..8194ce2f 100644 --- a/src/MailClient/Data/Reader/DefaultPlainReadableStrategy.php +++ b/src/Mail/Client/Reader/DefaultPlainReadableStrategy.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Reader; +namespace Conjoon\Mail\Client\Reader; /** * DefaultPlainReadableStrategy. * * Strips all html-tags and makes sure proper line breaks are applied if necessary. * - * @package Conjoon\MailClient\Data\Reader + * @package Conjoon\Mail\Client\Reader */ class DefaultPlainReadableStrategy implements PlainReadableStrategy { diff --git a/src/MailClient/Data/Reader/HtmlReadableStrategy.php b/src/Mail/Client/Reader/HtmlReadableStrategy.php similarity index 91% rename from src/MailClient/Data/Reader/HtmlReadableStrategy.php rename to src/Mail/Client/Reader/HtmlReadableStrategy.php index a2450f99..515c9471 100644 --- a/src/MailClient/Data/Reader/HtmlReadableStrategy.php +++ b/src/Mail/Client/Reader/HtmlReadableStrategy.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Reader; +namespace Conjoon\Mail\Client\Reader; -use Conjoon\MailClient\Message\Text\HtmlTextStrategy; +use Conjoon\Mail\Client\Message\Text\HtmlTextStrategy; /** * Interface HtmlReadableStrategy @@ -37,7 +37,7 @@ * Implementing classes are advised to properly strip any unwanted/ unsecure/ layout-breaking * HTML tags from text. * - * @package Conjoon\MailClient\Data\Reader + * @package Conjoon\Mail\Client\Reader */ interface HtmlReadableStrategy extends HtmlTextStrategy { diff --git a/src/MailClient/Data/Reader/PlainReadableStrategy.php b/src/Mail/Client/Reader/PlainReadableStrategy.php similarity index 90% rename from src/MailClient/Data/Reader/PlainReadableStrategy.php rename to src/Mail/Client/Reader/PlainReadableStrategy.php index cc5b2564..b25d516a 100644 --- a/src/MailClient/Data/Reader/PlainReadableStrategy.php +++ b/src/Mail/Client/Reader/PlainReadableStrategy.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Reader; +namespace Conjoon\Mail\Client\Reader; -use Conjoon\MailClient\Message\Text\PlainTextStrategy; +use Conjoon\Mail\Client\Message\Text\PlainTextStrategy; /** * Interface PlainReadableStrategy * * - * @package Conjoon\MailClient\Data\Reader + * @package Conjoon\Mail\Client\Reader */ interface PlainReadableStrategy extends PlainTextStrategy { diff --git a/src/MailClient/Data/Reader/PurifiedHtmlStrategy.php b/src/Mail/Client/Reader/PurifiedHtmlStrategy.php similarity index 95% rename from src/MailClient/Data/Reader/PurifiedHtmlStrategy.php rename to src/Mail/Client/Reader/PurifiedHtmlStrategy.php index 9469e114..3eb875b8 100644 --- a/src/MailClient/Data/Reader/PurifiedHtmlStrategy.php +++ b/src/Mail/Client/Reader/PurifiedHtmlStrategy.php @@ -27,7 +27,7 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Reader; +namespace Conjoon\Mail\Client\Reader; use HTMLPurifier; use HTMLPurifier_Config; @@ -37,7 +37,7 @@ * * Uses \HtmlPurifier for processing texts. * - * @package Conjoon\MailClient\Data\Reader + * @package Conjoon\Mail\Client\Reader */ class PurifiedHtmlStrategy implements HtmlReadableStrategy { diff --git a/src/MailClient/Data/Reader/ReadableMessagePartContentProcessor.php b/src/Mail/Client/Reader/ReadableMessagePartContentProcessor.php similarity index 91% rename from src/MailClient/Data/Reader/ReadableMessagePartContentProcessor.php rename to src/Mail/Client/Reader/ReadableMessagePartContentProcessor.php index a13ec52a..4be5bc8c 100644 --- a/src/MailClient/Data/Reader/ReadableMessagePartContentProcessor.php +++ b/src/Mail/Client/Reader/ReadableMessagePartContentProcessor.php @@ -25,15 +25,15 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Data\Reader; +namespace Conjoon\Mail\Client\Reader; -use Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessor; +use Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessor; use Conjoon\Text\Converter; /** * ReadableMessagePartContentProcessor. * - * @package Conjoon\MailClient\Message\Text + * @package Conjoon\Mail\Client\Message\Text */ class ReadableMessagePartContentProcessor extends AbstractMessagePartContentProcessor { diff --git a/src/MailClient/Data/Protocol/Http/Request/Transformer/AttachmentListJsonTransformer.php b/src/Mail/Client/Request/Attachment/Transformer/AttachmentListJsonTransformer.php similarity index 87% rename from src/MailClient/Data/Protocol/Http/Request/Transformer/AttachmentListJsonTransformer.php rename to src/Mail/Client/Request/Attachment/Transformer/AttachmentListJsonTransformer.php index d9caf56c..b544eb43 100644 --- a/src/MailClient/Data/Protocol/Http/Request/Transformer/AttachmentListJsonTransformer.php +++ b/src/Mail/Client/Request/Attachment/Transformer/AttachmentListJsonTransformer.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Conjoon\Mail\Client\Request\Attachment\Transformer; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\Core\Contract\JsonDecodable; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Util\JsonDecodable; /** * Interface AttachmentListJsonTransformer * Interface for setting up contracts for converting raw string/array data into a FileAttachmentList. * * - * @package Conjoon\MailClient\Data\Protocol\Http\Request\Transformer + * @package Conjoon\Mail\Client\Request\Attachment\Transformer */ interface AttachmentListJsonTransformer extends JsonDecodable { diff --git a/src/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageBodyDraftJsonTransformer.php b/src/Mail/Client/Request/Message/Transformer/DefaultMessageBodyDraftJsonTransformer.php similarity index 86% rename from src/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageBodyDraftJsonTransformer.php rename to src/Mail/Client/Request/Message/Transformer/DefaultMessageBodyDraftJsonTransformer.php index 3c5ce9ad..31514c64 100644 --- a/src/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageBodyDraftJsonTransformer.php +++ b/src/Mail/Client/Request/Message/Transformer/DefaultMessageBodyDraftJsonTransformer.php @@ -27,20 +27,19 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Conjoon\Mail\Client\Request\Message\Transformer; -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Exception\JsonDecodeException; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodeException; use Exception; /** * Class DefaultMessageBodyDraftJsonTransformer * - * @package Conjoon\MailClient\Message\Request\Transformer + * @package Conjoon\Mail\Client\Message\Request\Transformer */ class DefaultMessageBodyDraftJsonTransformer implements MessageBodyDraftJsonTransformer { @@ -73,11 +72,11 @@ public static function fromArray(array $arr): MessageBodyDraft $textPlain = null; if (isset($arr["textPlain"])) { - $textPlain = new MessagePart($arr["textPlain"], "UTF-8", MimeType::TEXT_PLAIN); + $textPlain = new MessagePart($arr["textPlain"], "UTF-8", "text/plain"); } if (isset($arr["textHtml"])) { - $textHtml = new MessagePart($arr["textHtml"], "UTF-8", MimeType::TEXT_HTML); + $textHtml = new MessagePart($arr["textHtml"], "UTF-8", "text/html"); } $messageKey = null; diff --git a/src/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageItemDraftJsonTransformer.php b/src/Mail/Client/Request/Message/Transformer/DefaultMessageItemDraftJsonTransformer.php similarity index 91% rename from src/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageItemDraftJsonTransformer.php rename to src/Mail/Client/Request/Message/Transformer/DefaultMessageItemDraftJsonTransformer.php index b68e00ae..970fc7a3 100644 --- a/src/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageItemDraftJsonTransformer.php +++ b/src/Mail/Client/Request/Message/Transformer/DefaultMessageItemDraftJsonTransformer.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Http\Request\Transformer; - -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Exception\JsonDecodeException; +namespace Conjoon\Mail\Client\Request\Message\Transformer; + +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodeException; use DateTime; use Exception; @@ -47,7 +47,7 @@ * will not pass the values to the constructor to make sure the data changed here is marked as * modified. * - * @package Conjoon\MailClient\Message\Request\Transformer + * @package Conjoon\Mail\Client\Message\Request\Transformer */ class DefaultMessageItemDraftJsonTransformer implements MessageItemDraftJsonTransformer { diff --git a/src/MailClient/Data/Protocol/Http/Request/Transformer/MessageBodyDraftJsonTransformer.php b/src/Mail/Client/Request/Message/Transformer/MessageBodyDraftJsonTransformer.php similarity index 87% rename from src/MailClient/Data/Protocol/Http/Request/Transformer/MessageBodyDraftJsonTransformer.php rename to src/Mail/Client/Request/Message/Transformer/MessageBodyDraftJsonTransformer.php index bf10c21d..75996798 100644 --- a/src/MailClient/Data/Protocol/Http/Request/Transformer/MessageBodyDraftJsonTransformer.php +++ b/src/Mail/Client/Request/Message/Transformer/MessageBodyDraftJsonTransformer.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Conjoon\Mail\Client\Request\Message\Transformer; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\Core\Contract\JsonDecodable; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Util\JsonDecodable; /** * Interface provides contract for processing data to a MessageBodyDraft. * - * @package Conjoon\MailClient\Data\Protocol\Http\Request\Transformer + * @package Conjoon\Mail\Client\Request\Message\Transformer */ interface MessageBodyDraftJsonTransformer extends JsonDecodable { diff --git a/src/MailClient/Data/Protocol/Http/Request/Transformer/MessageItemDraftJsonTransformer.php b/src/Mail/Client/Request/Message/Transformer/MessageItemDraftJsonTransformer.php similarity index 87% rename from src/MailClient/Data/Protocol/Http/Request/Transformer/MessageItemDraftJsonTransformer.php rename to src/Mail/Client/Request/Message/Transformer/MessageItemDraftJsonTransformer.php index 093cf5c4..a890b946 100644 --- a/src/MailClient/Data/Protocol/Http/Request/Transformer/MessageItemDraftJsonTransformer.php +++ b/src/Mail/Client/Request/Message/Transformer/MessageItemDraftJsonTransformer.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Conjoon\Mail\Client\Request\Message\Transformer; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\Core\Contract\JsonDecodable; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Util\JsonDecodable; /** * Interface provides contract for processing data to a MessageItemDraft. * - * @package Conjoon\MailClient\Data\Protocol\Http\Request\Transformer + * @package Conjoon\Mail\Client\Request\Message\Transformer */ interface MessageItemDraftJsonTransformer extends JsonDecodable { diff --git a/src/MailClient/Service/AttachmentService.php b/src/Mail/Client/Service/AttachmentService.php similarity index 87% rename from src/MailClient/Service/AttachmentService.php rename to src/Mail/Client/Service/AttachmentService.php index 3324dd31..4fc1f3fd 100644 --- a/src/MailClient/Service/AttachmentService.php +++ b/src/Mail/Client/Service/AttachmentService.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItemList; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\MailClient; +use Conjoon\Mail\Client\Attachment\FileAttachmentItemList; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\MailClient; /** * Interface AttachmentService * - * @package Conjoon\MailClient\Service + * @package Conjoon\Mail\Client\Service */ interface AttachmentService { diff --git a/src/MailClient/Service/AuthService.php b/src/Mail/Client/Service/AuthService.php similarity index 95% rename from src/MailClient/Service/AuthService.php rename to src/Mail/Client/Service/AuthService.php index 6faa43ef..b7e693eb 100644 --- a/src/MailClient/Service/AuthService.php +++ b/src/Mail/Client/Service/AuthService.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; /** * AuthService contract. diff --git a/src/MailClient/Service/DefaultAttachmentService.php b/src/Mail/Client/Service/DefaultAttachmentService.php similarity index 90% rename from src/MailClient/Service/DefaultAttachmentService.php rename to src/Mail/Client/Service/DefaultAttachmentService.php index 1f4b7740..de491f78 100644 --- a/src/MailClient/Service/DefaultAttachmentService.php +++ b/src/Mail/Client/Service/DefaultAttachmentService.php @@ -27,19 +27,19 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItemList; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Message\Attachment\Processor\FileAttachmentProcessor; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\MailClient; +use Conjoon\Mail\Client\Attachment\FileAttachmentItemList; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Attachment\Processor\FileAttachmentProcessor; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\MailClient; /** * class DefaultAttachmentService * - * @package Conjoon\MailClient\Service + * @package Conjoon\Mail\Client\Service */ class DefaultAttachmentService implements AttachmentService { diff --git a/src/MailClient/Service/DefaultAuthService.php b/src/Mail/Client/Service/DefaultAuthService.php similarity index 96% rename from src/MailClient/Service/DefaultAuthService.php rename to src/Mail/Client/Service/DefaultAuthService.php index 54e9e32a..5b9ae426 100644 --- a/src/MailClient/Service/DefaultAuthService.php +++ b/src/Mail/Client/Service/DefaultAuthService.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; use Horde_Imap_Client_Exception; use Horde_Imap_Client_Socket; @@ -43,6 +43,7 @@ class DefaultAuthService implements AuthService */ public function authenticate(MailAccount $mailAccount): bool { + $connection = new Horde_Imap_Client_Socket(array( 'username' => $mailAccount->getInboxUser(), 'password' => $mailAccount->getInboxPassword(), diff --git a/src/MailClient/Service/DefaultMailFolderService.php b/src/Mail/Client/Service/DefaultMailFolderService.php similarity index 85% rename from src/MailClient/Service/DefaultMailFolderService.php rename to src/Mail/Client/Service/DefaultMailFolderService.php index f0559636..a2e29973 100644 --- a/src/MailClient/Service/DefaultMailFolderService.php +++ b/src/Mail/Client/Service/DefaultMailFolderService.php @@ -27,19 +27,18 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Folder\MailFolderChildList; -use Conjoon\MailClient\Folder\Tree\MailFolderTreeBuilder; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Folder\MailFolderChildList; +use Conjoon\Mail\Client\Folder\Tree\MailFolderTreeBuilder; +use Conjoon\Mail\Client\MailClient; /** * Class DefaultMailFolderService. * Default implementation of a MailFolderService. * - * @package Conjoon\MailClient\Service + * @package Conjoon\Mail\Client\Service */ class DefaultMailFolderService implements MailFolderService { @@ -93,10 +92,10 @@ public function getMailClient(): MailClient /** * @inheritdoc */ - public function getMailFolderChildList(MailAccount $mailAccount, ?MailFolderListQuery $query = null): MailFolderChildList + public function getMailFolderChildList(MailAccount $mailAccount): MailFolderChildList { - $mailFolderList = $this->getMailClient()->getMailFolderList($mailAccount, $query); + $mailFolderList = $this->getMailClient()->getMailFolderList($mailAccount); - return $this->getMailFolderTreeBuilder()->listToTree($mailFolderList, $mailAccount->getRoot(), $query); + return $this->getMailFolderTreeBuilder()->listToTree($mailFolderList, $mailAccount->getRoot()); } } diff --git a/src/MailClient/Service/DefaultMessageItemService.php b/src/Mail/Client/Service/DefaultMessageItemService.php similarity index 77% rename from src/MailClient/Service/DefaultMessageItemService.php rename to src/Mail/Client/Service/DefaultMessageItemService.php index d9300ee3..46119c9b 100644 --- a/src/MailClient/Service/DefaultMessageItemService.php +++ b/src/Mail/Client/Service/DefaultMessageItemService.php @@ -27,36 +27,28 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; - -use Conjoon\Mime\MimeType; -use Conjoon\Data\ParameterBag; -use Conjoon\Data\Sort\SortInfoList; -use Conjoon\Data\Filter\Filter; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\Resource\MessageBodyOptions; -use Conjoon\MailClient\Data\Resource\Query\MessageBodyQuery; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Message\Text\MessageItemFieldsProcessor; -use Conjoon\MailClient\Message\Text\PreviewTextProcessor; -use Conjoon\MailClient\Data\Reader\ReadableMessagePartContentProcessor; -use Conjoon\MailClient\Data\Resource\Query\MessageItemListQuery; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; -use Conjoon\MailClient\Data\Writer\WritableMessagePartContentProcessor; -use Conjoon\Core\Util\ArrayUtil; -use Conjoon\Math\Expression\FunctionalExpression; -use Conjoon\Math\Value; -use Conjoon\Math\VariableName; +namespace Conjoon\Mail\Client\Service; + +use Conjoon\Core\ParameterBag; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Message\Text\MessageItemFieldsProcessor; +use Conjoon\Mail\Client\Message\Text\PreviewTextProcessor; +use Conjoon\Mail\Client\Reader\ReadableMessagePartContentProcessor; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; +use Conjoon\Mail\Client\Writer\WritableMessagePartContentProcessor; +use Conjoon\Util\ArrayUtil; /** * Class DefaultMessageItemService. @@ -167,7 +159,7 @@ public function getWritableMessagePartContentProcessor(): WritableMessagePartCon /** * @inheritdoc */ - public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $query): MessageItemList + public function getMessageItemList(FolderKey $folderKey, MessageItemListResourceQuery $query): MessageItemList { $messageItemList = $this->mailClient->getMessageItemList( $folderKey, @@ -176,6 +168,8 @@ public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $q foreach ($messageItemList as $listMessageItem) { $this->charsetConvertHeaderFields($listMessageItem); + $processedPart = $this->processTextForPreview($listMessageItem->getMessagePart(), $query); + $listMessageItem->setMessagePart($processedPart); } return $messageItemList; @@ -185,9 +179,9 @@ public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $q /** * @inheritdoc */ - public function getMessageItem(MessageKey $messageKey, MessageItemQuery $query): MessageItem + public function getMessageItem(MessageKey $messageKey): MessageItem { - $messageItem = $this->mailClient->getMessageItem($messageKey, $query); + $messageItem = $this->mailClient->getMessageItem($messageKey); $this->charsetConvertHeaderFields($messageItem); return $messageItem; } @@ -213,9 +207,24 @@ public function deleteMessage(MessageKey $messageKey): bool /** * @inheritdoc */ - public function getMessageItemDraft(MessageKey $messageKey, MessageItemQuery $query): ?MessageItemDraft + public function getListMessageItem(MessageKey $messageKey): ListMessageItem { - $messageItemDraft = $this->mailClient->getMessageItemDraft($messageKey, $query); + $messageItemList = $this->getMessageItemList( + $messageKey->getFolderKey(), + new MessageItemListResourceQuery(new ParameterBag([ + "ids" => [$messageKey->getId()] + ])) + ); + + return $messageItemList[0]; + } + + /** + * @inheritdoc + */ + public function getMessageItemDraft(MessageKey $messageKey): ?MessageItemDraft + { + $messageItemDraft = $this->mailClient->getMessageItemDraft($messageKey); $this->charsetConvertHeaderFields($messageItemDraft); return $messageItemDraft; } @@ -255,7 +264,7 @@ public function getMessageBody(MessageKey $messageKey): MessageBody */ public function getUnreadMessageCount(FolderKey $folderKey): int { - return $this->getMailClient()->getMessageCount($folderKey)["unreadMessages"]; + return $this->getMailClient()->getUnreadMessageCount($folderKey); } @@ -264,7 +273,7 @@ public function getUnreadMessageCount(FolderKey $folderKey): int */ public function getTotalMessageCount(FolderKey $folderKey): int { - return $this->getMailClient()->getMessageCount($folderKey)["totalMessages"]; + return $this->getMailClient()->getTotalMessageCount($folderKey); } /** @@ -292,22 +301,6 @@ public function moveMessage(MessageKey $messageKey, FolderKey $folderKey): ?Mess } - /** - * @inheritdoc - */ - public function createMessageDraft(FolderKey $folderKey, MessageItemDraft $draft): ?MessageItemDraft - { - - if ($draft->getMessageKey()) { - throw new ServiceException( - "Cannot create a MessageItemDraft that has a MessageKey" - ); - } - - return $this->getMailClient()->createMessageDraft($folderKey, $draft); - } - - /** * @inheritdoc */ @@ -394,26 +387,18 @@ protected function processMessageBodyDraft(MessageBodyDraft $messageBodyDraft): $htmlPart = $messageBodyDraft->getTextHtml(); if (!$plainPart && $htmlPart) { - $plainPart = new MessagePart( - $htmlPart->getContents(), - $htmlPart->getCharset(), - MimeType::TEXT_PLAIN - ); + $plainPart = new MessagePart($htmlPart->getContents(), $htmlPart->getCharset(), "text/plain"); $messageBodyDraft->setTextPlain($plainPart); } if ($plainPart && !$htmlPart) { - $htmlPart = new MessagePart( - $plainPart->getContents(), - $plainPart->getCharset(), - MimeType::TEXT_HTML - ); + $htmlPart = new MessagePart($plainPart->getContents(), $plainPart->getCharset(), "text/html"); $messageBodyDraft->setTextHtml($htmlPart); } if (!$plainPart && !$htmlPart) { - $plainPart = new MessagePart("", $targetCharset, MimeType::TEXT_PLAIN); + $plainPart = new MessagePart("", $targetCharset, "text/plain"); $messageBodyDraft->setTextPlain($plainPart); - $htmlPart = new MessagePart("", $targetCharset, MimeType::TEXT_HTML); + $htmlPart = new MessagePart("", $targetCharset, "text/html"); $messageBodyDraft->setTextHtml($htmlPart); } @@ -476,31 +461,38 @@ protected function processMessageBody(MessageBody $messageBody): MessageBody /** * Processes the specified MessagePart and returns its contents properly converted to UTF-8 * and stripped of all HTML-tags. - * Length property will be extracted from the $options. + * Length property will be extracted from the $query, if available. * - * @param MessagePart $messagePart The message part that should be looked up - * @param MessageBodyOptions|null $options The options available for processing the MessagePart - * - * @return MessagePart|null + * @param ?MessagePart $messagePart + * @param MessageItemListResourceQuery $query + * @return MessagePart * * @see PreviewTextProcessor::process */ protected function processTextForPreview( - MessagePart $messagePart, - ?MessageBodyOptions $options - ): MessagePart { + ?MessagePart $messagePart, + MessageItemListResourceQuery $query + ): ?MessagePart { + $attr = $query->attributes ?? []; - $mimeType = $messagePart->getMimeType(); + if (!$messagePart && empty($attr["html"]) && empty($attr["plain"])) { + return null; + } - $opts = []; + if (!$messagePart) { + $messagePart = new MessagePart( + "", + "UTF-8", + isset($attr["plain"]) ? "text/plain" : "text/html" + ); + } - $trimApi = false; - $length = null; + $path = $messagePart->getMimeType() === "text/plain" ? "plain" : "html"; - if ($options) { - $length = $options->getLength($mimeType); - $trimApi = $options->getTrimApi($mimeType); - } + $opts = []; + $attr = $query->attributes ?? []; + $length = ArrayUtil::unchain("$path.length", $attr); + $trimApi = ArrayUtil::unchain("$path.trimApi", $attr); if ($trimApi && $length) { $opts["length"] = $length; diff --git a/src/MailClient/Service/MailFolderService.php b/src/Mail/Client/Service/MailFolderService.php similarity index 85% rename from src/MailClient/Service/MailFolderService.php rename to src/Mail/Client/Service/MailFolderService.php index 365ff01d..c7b4b995 100644 --- a/src/MailClient/Service/MailFolderService.php +++ b/src/Mail/Client/Service/MailFolderService.php @@ -27,12 +27,11 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Folder\MailFolderChildList; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Folder\MailFolderChildList; +use Conjoon\Mail\Client\MailClient; interface MailFolderService { @@ -41,8 +40,6 @@ interface MailFolderService * MailAccount. * * @param MailAccount $mailAccount - * @param MailFolderListQuery|null $query An additional set of options to consider when - * querying the list * * @return MailFolderChildList An MailFolderChildList of the Mailbox-structure * found on the server. @@ -58,7 +55,7 @@ interface MailFolderService * * @see \Horde_Imap_Client_Socket */ - public function getMailFolderChildList(MailAccount $mailAccount, ?MailFolderListQuery $query = null): MailFolderChildList; + public function getMailFolderChildList(MailAccount $mailAccount): MailFolderChildList; /** diff --git a/src/MailClient/Service/MessageItemService.php b/src/Mail/Client/Service/MessageItemService.php similarity index 72% rename from src/MailClient/Service/MessageItemService.php rename to src/Mail/Client/Service/MessageItemService.php index 78c896d4..7e354b62 100644 --- a/src/MailClient/Service/MessageItemService.php +++ b/src/Mail/Client/Service/MessageItemService.php @@ -27,31 +27,30 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; - -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Exception\MailFolderNotFoundException; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\ListMessageItem; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Message\Text\MessageItemFieldsProcessor; -use Conjoon\MailClient\Message\Text\PreviewTextProcessor; -use Conjoon\MailClient\Data\Reader\ReadableMessagePartContentProcessor; -use Conjoon\MailClient\Data\Resource\Query\MessageItemListQuery; -use Conjoon\MailClient\Data\Writer\WritableMessagePartContentProcessor; +namespace Conjoon\Mail\Client\Service; + +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Message\Text\MessageItemFieldsProcessor; +use Conjoon\Mail\Client\Message\Text\PreviewTextProcessor; +use Conjoon\Mail\Client\Reader\ReadableMessagePartContentProcessor; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; +use Conjoon\Mail\Client\Writer\WritableMessagePartContentProcessor; /** - * Interface MessageItemService. + * Interface MessageItemService * * Provides a contract for MessageItem(List)/MessageBody related operations. + * + * @package Conjoon\Mail\Client\Service */ interface MessageItemService { @@ -60,27 +59,21 @@ interface MessageItemService * specified MailAccount and the MailFolder. * * @param FolderKey $folderKey - * @param MessageItemListQuery $query The resource query for the + * @param MessageItemListResourceQuery $query The resource query for the * MessageItemLi * * @return MessageItemList - * - * @throws MailFolderNotFoundException|MailClientException if the mail folder - * was not found, or a generic MailClientException indicating an error while - * communicating with the underlying (mail)backend. */ - public function getMessageItemList(FolderKey $folderKey, MessageItemListQuery $query): MessageItemList; + public function getMessageItemList(FolderKey $folderKey, MessageItemListResourceQuery $query): MessageItemList; /** * Returns a single MessageItem. * * @param MessageKey $messageKey - * @param MessageItemQuery $query - * * @return MessageItem */ - public function getMessageItem(MessageKey $messageKey, MessageItemQuery $query): MessageItem; + public function getMessageItem(MessageKey $messageKey): MessageItem; /** @@ -93,40 +86,30 @@ public function deleteMessage(MessageKey $messageKey): bool; /** - * Returns a single MessageItemDraft. + * Returns a single ListMessageItem. * * @param MessageKey $messageKey - * @param MessageItemQuery $query - * - * @return MessageItemDraft|null or null if no entity for the key was found + * @return ListMessageItem */ - public function getMessageItemDraft(MessageKey $messageKey, MessageItemQuery $query): ?MessageItemDraft; + public function getListMessageItem(MessageKey $messageKey): ListMessageItem; /** - * Returns a single MessageBody. + * Returns a single MessageItemDraft. * * @param MessageKey $messageKey - * @return MessageBody + * @return MessageItemDraft or null if no entity for the key was found */ - public function getMessageBody(MessageKey $messageKey): MessageBody; + public function getMessageItemDraft(MessageKey $messageKey): ?MessageItemDraft; /** - * Creates a single MessageItemDraft and returns it along with the generated MessageKey. - * Returns null if the MessageItemDraft could not be created. - * The created message will be marked as a draft. - * - * @param FolderKey $folderKey - * @param MessageItemDraft $draft The draft to create - * - * @return MessageItemDraft|null + * Returns a single MessageBody. * - * @throws ServiceException|MailFolderNotFoundException|MailClientException if the draft cannot be used - * with this service, if the mail folder was not found, or a generic MailClientException indicating an error while - * communicating with the underlying (mail)backend. + * @param MessageKey $messageKey + * @return MessageBody */ - public function createMessageDraft(FolderKey $folderKey, MessageItemDraft $draft): ?MessageItemDraft; + public function getMessageBody(MessageKey $messageKey): MessageBody; /** @@ -137,7 +120,7 @@ public function createMessageDraft(FolderKey $folderKey, MessageItemDraft $draft * @param FolderKey $folderKey * @param MessageBodyDraft $draft The draft to create * - * @return MessageBodyDraft|null + * @return MessageBodyDraft * * @throws ServiceException if $draft already has a MessageKey */ @@ -153,7 +136,7 @@ public function createMessageBodyDraft(FolderKey $folderKey, MessageBodyDraft $d * * @param MessageBodyDraft $draft The draft to create * - * @return MessageBodyDraft|null + * @return MessageBodyDraft * * @throws ServiceException if $draft has no messageKey */ diff --git a/src/MailClient/Service/ServiceException.php b/src/Mail/Client/Service/ServiceException.php similarity index 94% rename from src/MailClient/Service/ServiceException.php rename to src/Mail/Client/Service/ServiceException.php index 19bbe7e5..e7e1298f 100644 --- a/src/MailClient/Service/ServiceException.php +++ b/src/Mail/Client/Service/ServiceException.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Service; +namespace Conjoon\Mail\Client\Service; use RuntimeException; /** * Class ServiceException * - * @package Conjoon\MailClient\Service + * @package Conjoon\Mail\Client\Service */ class ServiceException extends RuntimeException { diff --git a/src/Mail/Client/Util/JsonApiStrategy.php b/src/Mail/Client/Util/JsonApiStrategy.php new file mode 100644 index 00000000..58cd8011 --- /dev/null +++ b/src/Mail/Client/Util/JsonApiStrategy.php @@ -0,0 +1,90 @@ +toArray(); + + $types = [ + "mailFolderId" => "MailFolder", + "mailAccountId" => "MailAccount", + ]; + + $result = [ + "attributes" => [] + ]; + + foreach ($data as $field => $value) { + if (in_array($field, ["id", "type"])) { + $result[$field] = $value; + continue; + } + + if (in_array($field, ["mailFolderId", "mailAccountId"])) { + if (!isset($result["relationships"])) { + $result["relationships"] = []; + } + $result["relationships"]["$types[$field]s"] = [ + "data" => [ + "id" => $value, + "type" => $types[$field] + ] + ]; + continue; + } + + $result["attributes"][$field] =$value; + + } + + return $result; + } +} diff --git a/src/MailClient/Data/Writer/DefaultHtmlWritableStrategy.php b/src/Mail/Client/Writer/DefaultHtmlWritableStrategy.php similarity index 94% rename from src/MailClient/Data/Writer/DefaultHtmlWritableStrategy.php rename to src/Mail/Client/Writer/DefaultHtmlWritableStrategy.php index c9da93bc..0f0530df 100644 --- a/src/MailClient/Data/Writer/DefaultHtmlWritableStrategy.php +++ b/src/Mail/Client/Writer/DefaultHtmlWritableStrategy.php @@ -27,12 +27,12 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Writer; +namespace Conjoon\Mail\Client\Writer; /** * Class DefaultHtmlWritableStrategy * - * @package Conjoon\MailClient\Data\Writer + * @package Conjoon\Mail\Client\Writer */ class DefaultHtmlWritableStrategy implements HtmlWritableStrategy { diff --git a/src/MailClient/Data/Writer/DefaultPlainWritableStrategy.php b/src/Mail/Client/Writer/DefaultPlainWritableStrategy.php similarity index 95% rename from src/MailClient/Data/Writer/DefaultPlainWritableStrategy.php rename to src/Mail/Client/Writer/DefaultPlainWritableStrategy.php index e6fe21f0..de927090 100644 --- a/src/MailClient/Data/Writer/DefaultPlainWritableStrategy.php +++ b/src/Mail/Client/Writer/DefaultPlainWritableStrategy.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Writer; +namespace Conjoon\Mail\Client\Writer; /** * DefaultPlainReadableStrategy. * * Strips all html-tags and makes sure proper line breaks are applied if necessary. * - * @package Conjoon\MailClient\Data\Reader + * @package Conjoon\Mail\Client\Reader */ class DefaultPlainWritableStrategy implements PlainWritableStrategy { diff --git a/src/MailClient/Data/Writer/HtmlWritableStrategy.php b/src/Mail/Client/Writer/HtmlWritableStrategy.php similarity index 91% rename from src/MailClient/Data/Writer/HtmlWritableStrategy.php rename to src/Mail/Client/Writer/HtmlWritableStrategy.php index 6b8d7577..d597f683 100644 --- a/src/MailClient/Data/Writer/HtmlWritableStrategy.php +++ b/src/Mail/Client/Writer/HtmlWritableStrategy.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Writer; +namespace Conjoon\Mail\Client\Writer; -use Conjoon\MailClient\Message\Text\HtmlTextStrategy; +use Conjoon\Mail\Client\Message\Text\HtmlTextStrategy; /** * Interface HtmlWritableStrategy @@ -37,7 +37,7 @@ * Implementing classes are advised to properly make sure any required * formats are properly transformed to HTML-tags. * - * @package Conjoon\MailClient\Data\Writer + * @package Conjoon\Mail\Client\Writer */ interface HtmlWritableStrategy extends HtmlTextStrategy { diff --git a/src/MailClient/Data/Writer/PlainWritableStrategy.php b/src/Mail/Client/Writer/PlainWritableStrategy.php similarity index 90% rename from src/MailClient/Data/Writer/PlainWritableStrategy.php rename to src/Mail/Client/Writer/PlainWritableStrategy.php index 19b1fd3c..03d196af 100644 --- a/src/MailClient/Data/Writer/PlainWritableStrategy.php +++ b/src/Mail/Client/Writer/PlainWritableStrategy.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\MailClient\Data\Writer; +namespace Conjoon\Mail\Client\Writer; -use Conjoon\MailClient\Message\Text\PlainTextStrategy; +use Conjoon\Mail\Client\Message\Text\PlainTextStrategy; /** * Interface PlainReadableStrategy * * - * @package Conjoon\MailClient\Data\Reader + * @package Conjoon\Mail\Client\Reader */ interface PlainWritableStrategy extends PlainTextStrategy { diff --git a/src/MailClient/Data/Writer/WritableMessagePartContentProcessor.php b/src/Mail/Client/Writer/WritableMessagePartContentProcessor.php similarity index 91% rename from src/MailClient/Data/Writer/WritableMessagePartContentProcessor.php rename to src/Mail/Client/Writer/WritableMessagePartContentProcessor.php index 98d31914..06163b05 100644 --- a/src/MailClient/Data/Writer/WritableMessagePartContentProcessor.php +++ b/src/Mail/Client/Writer/WritableMessagePartContentProcessor.php @@ -25,15 +25,15 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -namespace Conjoon\MailClient\Data\Writer; +namespace Conjoon\Mail\Client\Writer; -use Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessor; +use Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessor; use Conjoon\Text\Converter; /** * WritableMessagePartContentProcessor * - * @package Conjoon\MailClient\Message\Writer + * @package Conjoon\Mail\Client\Message\Writer */ class WritableMessagePartContentProcessor extends AbstractMessagePartContentProcessor { diff --git a/src/MailClient/Data/Protocol/Http/Response/JsonApiStrategy.php b/src/MailClient/Data/Protocol/Http/Response/JsonApiStrategy.php deleted file mode 100644 index 36b8af34..00000000 --- a/src/MailClient/Data/Protocol/Http/Response/JsonApiStrategy.php +++ /dev/null @@ -1,218 +0,0 @@ -transformFromError($source->toArray()); - } - - if ($source instanceof ValidationError) { - return $source->toArray(); - } - - if ($source instanceof ValidationErrors) { - return $this->fromValidationErrors($source); - } - - if ($source instanceof AbstractList) { - return $this->fromAbstractList($source); - } - - $data = $source->toArray(); - if (!isset($data["type"])) { - return $data; - } - - return $this->transform($data); - } - - - /** - * Implementation for the json strategy. - * - * @param array $data - * - * @return array|array[] - */ - protected function transform(array $data): array - { - $types = [ - "mailFolderId" => "MailFolder", - "mailAccountId" => "MailAccount", - ]; - - $result = [ - "attributes" => [] - ]; - - - $createRelationship = function ($key) use ($types, $data, &$result) { - if (!isset($data[$key])) { - return false; - } - if (!isset($result["relationships"])) { - $result["relationships"] = []; - } - $result["relationships"]["$types[$key]"] = [ - "data" => [ - "id" => $data[$key], - "type" => $types[$key] - ] - ]; - return true; - }; - - // look up MailFolderFirst, then create this relationship. - // nested MailAccount will not be reflected if a MailFolder is - // available, since the resource linkage to the owning MailAccount will - // be done given the MailFolder - $createRelationship("mailFolderId") || - $createRelationship("mailAccountId"); - - foreach ($data as $field => $value) { - if (in_array($field, ["id", "type"])) { - $result[$field] = $value; - continue; - } - - if (in_array($field, ["mailFolderId", "mailAccountId"])) { - continue; - } - - $result["attributes"][$field] = $value; - } - - // if type is MailFolder, recurse into child mail folders - $attributes = &$result["attributes"]; - if (isset($attributes["data"]) && $result["type"] === "MailFolder") { - $children = []; - foreach ($attributes["data"] as $node) { - $children[] = $this->transform($node); - } - $attributes["data"] = $children; - } - - return $result; - } - - - /** - * Makes sure the abstract list is properly transformed into its JSON representative by forwarding THIS - * strategy to each of its list entries. - * - * @param AbstractList $source - * - * @return array - */ - public function fromAbstractList(AbstractList $source): array - { - $data = []; - - foreach ($source as $item) { - $data[] = $item->toJson($this); - } - - return $data; - } - - - /** - * Makes sure the ValidationErrors-list is properly transformed into its JSON representative. - * - * @param ValidationErrors $source - * - * @return array - */ - public function fromValidationErrors(ValidationErrors $source): array - { - $data = []; - - foreach ($source as $item) { - $data[] = $item->toJson($this); - } - - return [ - "errors" => $data - ]; - } - - - /** - * Transforms from a Problem-representative to an JSON:API error object. - * - * @param array $data - * - * @return array - * - * @see https://jsonapi.org/format/#errors - */ - protected function transformFromError(array $data): array - { - $problem = [ - "title" => $data["title"] ?? null, - "status" => $data["status"] ?? null, - "detail" => $data["detail"] ?? null, - "links" => isset($data["type"]) && $data["type"] !== "about:blank" ? [ - "about" => $data["type"] - ] : null, - "meta" => isset($data["instance"]) ? [ - "instance" => $data["instance"] - ] : null - ]; - - return array_filter($problem, fn ($v) => !empty($v)); - } -} diff --git a/src/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategy.php b/src/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategy.php deleted file mode 100644 index f989dbb5..00000000 --- a/src/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategy.php +++ /dev/null @@ -1,105 +0,0 @@ -getExpression(); - } - - if ($target instanceof Expression) { - $ops = $target->getOperands(); - $operator = $target->getOperator(); - - if ($ops[0]->toString() === "UID" && $operator->toString() === ">=") { - return "(UID " . implode(":", array_slice($ops->toArray(), 1)) . ":*)"; - } - - if ($ops[0]->toString() === "UID" && $operator->toString() === "IN") { - return "(UID " . implode(":", array_slice($ops->toArray(), 1)) . ")"; - } - - if ($operator->toString() === "==" && is_bool($ops[1]->getValue())) { - return "(" . $ops[0]->toString() . ")"; - } - - return - implode( - " ", - array_merge( - [$target->getOperator()->toString($this)], - $ops->map(fn ($op) => $op->toString($this)) - ) - ); - } - - if ($target instanceof Operator) { - $repl = ["||" => "OR", "&&" => "AND"]; - $str = $target->toString(); - return $repl[$str] ?? $str; - } - - if ($target instanceof Operand) { - return $target->toString(); - } - - throw new UnexpectedTypeException( - sprintf( - "Expected an argument of type %1s, %2s or %3s", - Expression::class, - Operator::class, - Operand::class - ) - ); - } -} diff --git a/src/MailClient/Data/Resource/MailAccount.php b/src/MailClient/Data/Resource/MailAccount.php deleted file mode 100644 index 2aceb1c1..00000000 --- a/src/MailClient/Data/Resource/MailAccount.php +++ /dev/null @@ -1,109 +0,0 @@ -operands; - } - - - /** - * Returns the operator used with this expression. - * - * @return Operator - */ - public function getOperator(): Operator - { - return $this->operator; - } - - - /** - * @inheritdoc - */ - public function toString(StringStrategy $stringStrategy = null): string - { - if (!$stringStrategy) { - $operands = $this->getOperands()->toArray(); - - return "(" . ( - count($operands) == 1 - ? $this->getOperator()->toString() . "" . $operands[0] - : implode( - $this->getOperator()->toString(), - $operands - ) - ) . ")"; - } - - return $stringStrategy->toString($this); - } - - - /** - * @inheritdoc - */ - public function toArray(): array - { - $ops = $this->getOperands()->toArray(); - - array_unshift( - $ops, - $this->getOperator()->toString() - ); - - return $ops; - } - - - /** - * @inheritdoc - */ - public function toJson(JsonStrategy $strategy = null): array - { - if (!$strategy) { - return $this->toArray(); - } - - return $strategy->toJson($this); - } - - /** - * @return mixed - * - * @throws InvalidOperationException - */ - public function getValue(): mixed - { - throw new InvalidOperationException("getValue() not supported for this expression"); - } -} diff --git a/src/Math/Expression/ExpressionList.php b/src/Math/Expression/ExpressionList.php deleted file mode 100644 index 27f483a4..00000000 --- a/src/Math/Expression/ExpressionList.php +++ /dev/null @@ -1,61 +0,0 @@ -data as $data) { - $res[] = $data->toArray(); - } - - return $res; - } -} diff --git a/src/Math/Expression/FunctionalExpression.php b/src/Math/Expression/FunctionalExpression.php deleted file mode 100644 index 2d714e09..00000000 --- a/src/Math/Expression/FunctionalExpression.php +++ /dev/null @@ -1,119 +0,0 @@ -toString(); // seen IN (1, "foo", false, true) - * - */ -class FunctionalExpression extends Expression -{ - use OperatorCallTrait; - - /** - * @inheritdoc - */ - public static function getOperatorClass(): string - { - return FunctionalOperator::class; - } - - - /** - * Constructor. - * - * @param OperandList $operands - * - * @param FunctionalOperator $operator - * - * @throws InvalidOperandException - */ - public function __construct(FunctionalOperator $operator, OperandList $operands) - { - $operandCount = count($operands); - - if ($operator === FunctionalOperator::IN && $operandCount < 2) { - throw new InvalidOperandException( - "FunctionalExpression \"IN\" expects at least 2 operands, {$operandCount} given" - ); - } - - $this->operands = $operands; - $this->operator = $operator; - } - - - /** - * @inheritdoc - */ - public function toString(StringStrategy $strategy = null): string - { - if ($strategy) { - return parent::toString($strategy); - } - - if ($this->getOperator() === FunctionalOperator::IN) { - return "(" . implode(" ", [ - $this->getOperands()[0]->toString(), - $this->getOperator()->toString(), - "(" . implode(", ", array_slice($this->getOperands()->toArray(), 1)) . ")", - ]) . ")"; - } - - return parent::toString(); - } -} diff --git a/src/Math/Expression/LogicalExpression.php b/src/Math/Expression/LogicalExpression.php deleted file mode 100644 index 8d9e946e..00000000 --- a/src/Math/Expression/LogicalExpression.php +++ /dev/null @@ -1,97 +0,0 @@ -toString(); // !true - * - * $operator = LogicalOperator::AND; - * $expression = new LogicalExpression( - * $operator, Value::make(1), Value::make(2), Value::make(3) - * ); - * $expression->toString(); // 1 && 2 && 3 - */ -class LogicalExpression extends Expression -{ - use OperatorCallTrait; - - /** - * @inheritdoc - */ - public static function getOperatorClass(): string - { - return LogicalOperator::class; - } - - - /** - * Constructor. - * A logical expression expects an arbitrary number of operands for a conjunction (AND) - * or disjunction (OR), and exactly one operand for a negation (!, i.e. NOT). - * - * @param OperandList $operands - * - * @param LogicalOperator $operator - */ - public function __construct(LogicalOperator $operator, OperandList $operands) - { - $operandCount = count($operands); - - if ($operator === LogicalOperator::NOT && $operandCount !== 1) { - throw new InvalidOperandException( - "LogicalExpression representing a negation expects 1 operand, {$operandCount} given" - ); - } - - if ($operandCount <= 1 && $operator !== LogicalOperator::NOT) { - throw new InvalidOperandException( - "LogicalExpression representing a conjunction or disjunction expects at least 2 " . - "operands, {$operandCount} given" - ); - } - - $this->operands = $operands; - $this->operator = $operator; - } -} diff --git a/src/Math/Expression/Notation/PolishNotation.php b/src/Math/Expression/Notation/PolishNotation.php deleted file mode 100644 index 081a5b32..00000000 --- a/src/Math/Expression/Notation/PolishNotation.php +++ /dev/null @@ -1,97 +0,0 @@ -assertSame("== 1 2", $expression->toString(new PolishNotation())); - * - * - */ -class PolishNotation implements StringStrategy -{ - /** - * Transforms the $target into polish notation. - * - * @param Stringable $target - * - * @return string - * - * @throws UnexpectedTypeException if $target is not an Expression. - */ - public function toString(Stringable $target): string - { - if ($target instanceof Expression) { - $ops = $target->getOperands(); - - return - implode( - " ", - array_merge( - [$target->getOperator()->toString($this)], - $ops->map(fn ($op) => $op->toString($this)) - ) - ); - } - - if ($target instanceof Operator) { - return $target->toString(); - } - - if ($target instanceof Operand) { - return $target->toString(); - } - - throw new UnexpectedTypeException( - sprintf( - "Expected an argument of type %1s, %2s or %3s", - Expression::class, - Operator::class, - Operand::class - ) - ); - } -} diff --git a/src/Math/Expression/Operator/FunctionalOperator.php b/src/Math/Expression/Operator/FunctionalOperator.php deleted file mode 100644 index 7f9f8120..00000000 --- a/src/Math/Expression/Operator/FunctionalOperator.php +++ /dev/null @@ -1,45 +0,0 @@ -toString($this); - } - - return $this->value; - } -} diff --git a/src/Math/Expression/Operator/RelationalOperator.php b/src/Math/Expression/Operator/RelationalOperator.php deleted file mode 100644 index 66afcbc5..00000000 --- a/src/Math/Expression/Operator/RelationalOperator.php +++ /dev/null @@ -1,50 +0,0 @@ -"; - - case LT = "<"; - - case LE = "<="; - - case GE = ">="; -} diff --git a/src/Math/Expression/OperatorCallTrait.php b/src/Math/Expression/OperatorCallTrait.php deleted file mode 100644 index 2f35a2ce..00000000 --- a/src/Math/Expression/OperatorCallTrait.php +++ /dev/null @@ -1,88 +0,0 @@ -toString(); // 1 == 2 - */ -trait OperatorCallTrait -{ - /** - * Returns the fqn of the Operator this expression is using. - * - * @return string - */ - abstract public static function getOperatorClass(): string; - - - /** - * Shorthand for directly using static methods named after the available operators for this - * expression. - * - * @param string $method - * @param array $arguments - * - * @return Expression - * - * @throws BadMethodCallException - */ - public static function __callStatic(string $method, array $arguments): Expression - { - $method = strtoupper($method); - - try { - $operator = constant(self::getOperatorClass() . "::$method"); - } catch (Error $error) { - throw new BadMethodCallException("{$method} does not exist: " . $error->getMessage()); - } - - return new static( - $operator, - OperandList::make(...$arguments) - ); - } -} diff --git a/src/Math/Expression/RelationalExpression.php b/src/Math/Expression/RelationalExpression.php deleted file mode 100644 index 9bf0c179..00000000 --- a/src/Math/Expression/RelationalExpression.php +++ /dev/null @@ -1,84 +0,0 @@ -toString(); // 1 == 2 - */ -class RelationalExpression extends Expression -{ - use OperatorCallTrait; - - /** - * @inheritdoc - */ - public static function getOperatorClass(): string - { - return RelationalOperator::class; - } - - - /** - * Constructor. - * A relational expression expects two operands. - * - * @param OperandList $operands - * - * @param RelationalOperator $operator - */ - public function __construct(RelationalOperator $operator, OperandList $operands) - { - if (count($operands) !== 2) { - throw new InvalidOperandException( - "RelationalExpression expects 2 operands, " . count($operands) . " given" - ); - } - - $this->operands = $operands; - $this->operator = $operator; - } -} diff --git a/src/Math/InvalidOperandException.php b/src/Math/InvalidOperandException.php deleted file mode 100644 index a3669283..00000000 --- a/src/Math/InvalidOperandException.php +++ /dev/null @@ -1,39 +0,0 @@ -data as $data) { - $res[] = $data->toString(); - } - - return $res; - } -} diff --git a/src/Math/Value.php b/src/Math/Value.php deleted file mode 100644 index a3b9ce69..00000000 --- a/src/Math/Value.php +++ /dev/null @@ -1,124 +0,0 @@ -value = $value; - } - - /** - * @return mixed - */ - public function getValue(): mixed - { - return $this->value; - } - - - /** - * @return array - */ - public function toArray(): array - { - return [ - $this->getValue() - ]; - } - - - /** - * @param JsonStrategy|null $strategy - * @return array - */ - public function toJson(JsonStrategy $strategy = null): array - { - if (!$strategy) { - return $this->toArray(); - } - - return $strategy->toJson($this); - } - - - /** - * @param StringStrategy|null $stringStrategy - * @return string - */ - public function toString(StringStrategy $stringStrategy = null): string - { - if (!$stringStrategy) { - $value = $this->getValue(); - - switch (true) { - case ($value === true): - return "true"; - case ($value === false): - return "false"; - default: - return (string)$value; - } - } - - return $stringStrategy->toString($this); - } -} diff --git a/src/Math/Variable.php b/src/Math/Variable.php deleted file mode 100644 index 4fb3d872..00000000 --- a/src/Math/Variable.php +++ /dev/null @@ -1,131 +0,0 @@ -variableName = $variableName; - $this->value = $value; - } - - - /** - * @return string - */ - public function getName(): VariableName - { - return $this->variableName; - } - - - /** - * @return string - */ - public function getValue(): Value - { - return $this->value; - } - - - /** - * @return array - */ - public function toArray(): array - { - return [ - $this->getName()->toArray(), - $this->getValue()->toArray() - ]; - } - - - /** - * @param JsonStrategy|null $strategy - * @return array - */ - public function toJson(JsonStrategy $strategy = null): array - { - if (!$strategy) { - return $this->toArray(); - } - - return $strategy->toJson($this); - } - - - /** - * @param StringStrategy|null $stringStrategy - * @return string - */ - public function toString(StringStrategy $stringStrategy = null): string - { - if (!$stringStrategy) { - return $this->getName()->toString() . ":" . $this->getValue()->toString(); - } - - return $stringStrategy->toString($this); - } -} diff --git a/src/Math/VariableName.php b/src/Math/VariableName.php deleted file mode 100644 index e628665b..00000000 --- a/src/Math/VariableName.php +++ /dev/null @@ -1,115 +0,0 @@ -name = $name; - } - - /** - * @return string - */ - public function getValue(): string - { - return $this->name; - } - - - /** - * @return array - */ - public function toArray(): array - { - return [ - $this->getValue() - ]; - } - - - /** - * @param JsonStrategy|null $strategy - * @return array - */ - public function toJson(JsonStrategy $strategy = null): array - { - if (!$strategy) { - return $this->toArray(); - } - - return $strategy->toJson($this); - } - - - /** - * @param StringStrategy|null $stringStrategy - * @return string - */ - public function toString(StringStrategy $stringStrategy = null): string - { - if (!$stringStrategy) { - return $this->getValue(); - } - - return $stringStrategy->toString($this); - } -} diff --git a/src/Net/Exception/MalformedUrlException.php b/src/Net/Exception/MalformedUrlException.php deleted file mode 100644 index 3ea06e6c..00000000 --- a/src/Net/Exception/MalformedUrlException.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ - private readonly array $parts; - - - public static function make(string $uri): static - { - return new static($uri); - } - - /** - * @param string $uri - * - * @throws UriSyntaxException - */ - public function __construct(string $uri) - { - $this->uri = $uri; - $parts = parse_url($uri); - - if ($parts === false) { - throw new UriSyntaxException( - "Could not parse \"$uri\" into its parts" - ); - } - - $this->parts = $parts; - } - - - /** - * An URI is considered to be absolute if it has a scheme specified. - * - * @return bool true if this URI is absolute, otherwise false. - */ - public function isAbsolute(): bool - { - return $this->getScheme() !== null; - } - - /** - * Delegates to various getters available for the components of a URI. - * Getters are available for - * "scheme", "user", "pass", "host", "port", "path", "query", "fragment". - * - * @param string $name - * @param array $arguments - * - * @return mixed|string|null - * - * @throws BadMethodCallException - */ - public function __call(string $name, array $arguments) - { - $parts = ["scheme", "user", "pass", "host", "port", "path", "query", "fragment"]; - - $nameToPart = strtolower(substr($name, 3)); - - if (in_array($nameToPart, $parts)) { - return $this->parts[$nameToPart] ?? null; - } - - throw new BadMethodCallException( - "No method named \"$name\" found in " . static::class - ); - } - - - /** - * @param StringStrategy|null $stringStrategy - * @return string - */ - public function toString(StringStrategy $stringStrategy = null): string - { - return $stringStrategy ? $stringStrategy->toString($this) : $this->uri; - } -} diff --git a/src/Net/Uri/Component/Path/Template.php b/src/Net/Uri/Component/Path/Template.php deleted file mode 100644 index 0316a8e6..00000000 --- a/src/Net/Uri/Component/Path/Template.php +++ /dev/null @@ -1,179 +0,0 @@ -getVariableNames(); // ["mailFolderId"] - * - * $tpl->match(Uri::create("https://localhost:8080/MailFolder/2?query=value")); - * // ["mailFolderId" => "2"] - * - * $tpl->match(Uri::create("https://localhost:8080/path/MailFolder/2?query=value")); - * // since the PathTemplate represents an absolute path, the returned value is null - * - * $tpl = new PathTemplate("MailFolder/{mailFolderId}"); - * $tpl->match(Uri::create("https://localhost:8080/pathMailFolder/2?query=value")); - * // ["mailFolderId" => "2"] - * - */ -class Template implements Stringable, Equatable -{ - /** - * @var string - */ - private readonly string $templateString; - - /** - * @var ?array - */ - private ?array $pathParameterNames = null; - - /** - * @var TemplateRegex|null - */ - private ?TemplateRegex $uriTemplateRegex = null; - - /** - * Constructor. - * - * @param string $templateString - */ - public function __construct(string $templateString) - { - $this->templateString = $templateString; - } - - - /** - * If the submitted URI matches this template, an array of strings is returned, - * whereas the keys are the matched variable-names with their appropriate values. - * - * @example Example: - * $template = new PathTemplate("accounts/{user}/address/{shippingAddress}"); - * $template->match(new Uri("http://example.com/accounts/1/address/42")); - * // ["user" => 1, "shippingAddress" => 42] - * - * @param Uri $uri - * - * @return array|null - */ - public function match(Uri $uri): ?array - { - $uriRegex = $this->getUriTemplateRegex(); - $matches = $uriRegex->match($uri->getPath()); - - if ($matches === null) { - return null; - } - - $pathParameterList = []; - - foreach ($matches as $name => $value) { - $pathParameterList[$name] = $value; - } - - return $pathParameterList; - } - - - /** - * Returns all variable names found in this template. - * - * @return array - */ - public function getVariableNames(): array - { - if ($this->pathParameterNames) { - return $this->pathParameterNames; - } - - $prepReg = "/{(.+?)}/m"; - - $this->pathParameterNames = []; - - preg_match_all($prepReg, $this->templateString, $matches, PREG_SET_ORDER, 0); - - foreach ($matches as $match) { - $this->pathParameterNames[] = $match[1]; - } - - return $this->pathParameterNames; - } - - - /** - * @return TemplateRegex - */ - private function getUriTemplateRegex(): TemplateRegex - { - if (!$this->uriTemplateRegex) { - $this->uriTemplateRegex = new TemplateRegex($this->templateString); - } - return $this->uriTemplateRegex; - } - - - /** - * @param StringStrategy|null $stringStrategy - * @return string - */ - public function toString(StringStrategy $stringStrategy = null): string - { - return $stringStrategy ? $stringStrategy->toString($this) : $this->templateString; - } - - - /** - * @param object $target - * @return bool - */ - public function equals(object $target): bool - { - if (!($target instanceof Template)) { - throw new InvalidTypeException( - "\"target\" must be an instance of " . static::class . ", is " . get_class($target) - ); - } - - return strtolower($this->toString()) === strtolower($target->toString()); - } -} diff --git a/src/Net/Uri/Component/Path/TemplateRegex.php b/src/Net/Uri/Component/Path/TemplateRegex.php deleted file mode 100644 index 7708c818..00000000 --- a/src/Net/Uri/Component/Path/TemplateRegex.php +++ /dev/null @@ -1,133 +0,0 @@ -getRegexString() is "/\/Resources\/(?[^\?\/]+)\??[^\/]*$/m" - * // which matches: - * $pathTemplateRegex->match("Resources/24342?fields[Resources]=4"); // ["resourceId" => "24342"] - * $pathTemplateRegex->match("/Resources/someId"); // ["resourceId" => "someId"] - * - * // resource collections must be identified with their own PathTemplate, since: - * $pathTemplateRegex->match("/Resources?fields[Resources]=4"); // null - * - */ -class TemplateRegex -{ - /** - * @var string|null - */ - private ?string $regex = null; - - - /** - * @var string - */ - private string $templateString; - - - /** - * Constructor. - * - * @param string $templateString - */ - final public function __construct(string $templateString) - { - $this->templateString = $templateString; - } - - - /** - * Tries to match the $url against the regular expression this instance represents. - * Returns an array keyed with the names of all path parameters with their value - * set to the extracted values. - * Returns null if the $url did not match the regular expression. - * - * @param string $url - * @return array|null - * - * @see getRegexString - */ - public function match(string $url): ?array - { - $regex = $this->getRegexString(); - - preg_match_all($regex, $url, $matches, PREG_SET_ORDER, 0); - - if (count($matches) === 0 || !is_array($matches[0])) { - return null; - } - - $matches = $matches[0]; - return array_filter($matches, fn ($key) => !is_int($key), ARRAY_FILTER_USE_KEY); - } - - - /** - * Returns a regular expression built from this instance's $templateString. - * The regular expression contains groups named after the path-parameters found in the string. - * - * @return string - */ - private function getRegexString(): string - { - if ($this->regex) { - return $this->regex; - } - - $urlTemplate = $this->templateString; - - $prepReg = "/{(.+?)}/m"; - $subst = '(?<$1>[^\?\/]+)'; - $input = str_replace(["/", "?"], ["\\/", "\\?"], $urlTemplate); - - preg_match_all($prepReg, $input, $matches, PREG_SET_ORDER); - - /** @var string $input*/ - $output = preg_replace($prepReg, $subst, $input) . "\??[^\/]*$"; - - $this->regex = "/" . - (str_starts_with($urlTemplate, "/") ? "^" : "") . - "$output/m"; - - return $this->regex; - } -} diff --git a/src/Net/Uri/Component/Query.php b/src/Net/Uri/Component/Query.php deleted file mode 100644 index 9def3bb8..00000000 --- a/src/Net/Uri/Component/Query.php +++ /dev/null @@ -1,217 +0,0 @@ -|string> - */ - private array $parsedParameters = []; - - /** - * @var array - */ - private array $parameterList = []; - - - /** - * @var ParameterList|null - */ - private ?ParameterList $list = null; - - - /** - * Constructor. - * - * @param string|null $queryString - */ - public function __construct(string $queryString = null) - { - if ($queryString) { - parse_str($queryString, $this->parsedParameters); - } - - $this->queryString = $queryString ?? ""; - } - - /** - * Gets the parameter from this Query. Returns null if no parameter with the - * name exists with this query. - * - * @param string $name - * @return Parameter|null - */ - public function getParameter(string $name): ?Parameter - { - if (array_key_exists($name, $this->parameterList)) { - return $this->parameterList[$name]; - } - $exists = array_key_exists($name, $this->parsedParameters) ; - - if ($exists && !is_array($this->parsedParameters[$name])) { - $this->parameterList[$name] = new Parameter($name, $this->parsedParameters[$name]); - return $this->parameterList[$name]; - } - - if ($this->isGroupParameter($name)) { - $groupName = $this->getGroupName($name); - - if ($groupName) { - $groups = $this->parsedParameters[$groupName]; - - if (is_array($groups)) { - foreach ($groups as $iName => $value) { - if ($name === $groupName . "[" . $iName . "]") { - $this->parameterList[$name] = new Parameter($name, $value); - break; - } - } - } - } - } - - if (!array_key_exists($name, $this->parameterList)) { - $this->parameterList[$name] = null; - } - - return $this->parameterList[$name]; - } - - - /** - * Returns a ParameterList containing all the parameters of this query. - * - * @return ParameterList - */ - public function getAllParameters(): ParameterList - { - if ($this->list) { - return $this->list; - } - - $list = new ParameterList(); - - foreach ($this->parsedParameters as $key => $value) { - if (is_array($value)) { - foreach ($value as $groupName => $groupValue) { - $fieldName = $key . "[" . $groupName . "]"; - $currentParam = $this->getParameter($fieldName); - if ($currentParam) { - $list[] = $currentParam; - } - } - } else { - $currentParam = $this->getParameter($key); - if ($currentParam) { - $list[] = $currentParam; - } - } - } - - $this->list = $list; - return $list; - } - - - /** - * Returns an array containing all available parameter names of this query. - * Returns an empty array if no parameters are available. - * - * @return array - */ - public function getAllParameterNames(): array - { - return $this->getAllParameters()->map(fn ($param) => $param->getName()); - } - - - /** - * Returns a ParameterBag containing all the data from this parameters. - * - * @return ParameterBag - */ - public function getParameterBag(): ParameterBag - { - return new ParameterBag($this->getAllParameters()->toArray()); - } - - - /** - * @inheritdoc - */ - public function getName(): string - { - return $this->toString(); - } - - /** - * @inheritdoc - */ - public function getSource(): object - { - return $this; - } - - /** - * @inheritdoc - */ - public function toString(StringStrategy $stringStrategy = null): string - { - return $stringStrategy ? $stringStrategy->toString($this) : $this->queryString; - } - - /** - * @inheritdoc - * - * @return array - */ - public function toArray(): array - { - return $this->getAllParameters()->toArray(); - } -} diff --git a/src/Net/Uri/Component/Query/Parameter.php b/src/Net/Uri/Component/Query/Parameter.php deleted file mode 100644 index ec7441c4..00000000 --- a/src/Net/Uri/Component/Query/Parameter.php +++ /dev/null @@ -1,109 +0,0 @@ -name = $name; - $this->value = $value; - } - - - /** - * Returns the value this Parameter was created with. - * - * @return string - */ - public function getValue(): string - { - return $this->value; - } - - - /** - * Textual representation of this parameter's name. - * @return string - */ - public function getName(): string - { - return $this->name; - } - - - /** - * @inheritdoc - */ - public function getSource(): object - { - return $this; - } - - - /** - * @inheritdoc - */ - public function toString(StringStrategy $stringStrategy = null): string - { - return $this->getName() . "=" . $this->getValue(); - } - - /** - * @inheritdoc - * - * @return array - */ - public function toArray(): array - { - return ["parameter" => $this->getName()]; - } -} diff --git a/src/Net/Uri/Component/Query/ParameterList.php b/src/Net/Uri/Component/Query/ParameterList.php deleted file mode 100644 index 2e3cab68..00000000 --- a/src/Net/Uri/Component/Query/ParameterList.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class ParameterList extends AbstractList -{ - /** - * @inheritdoc - */ - public function getEntityType(): string - { - return Parameter::class; - } - - - /** - * @inheritdoc - * - * @return array - */ - public function toArray(): array - { - $data = []; - - foreach ($this->data as $parameter) { - $data[$parameter->getName()] = $parameter->getValue(); - } - - return $data; - } -} diff --git a/src/Net/Uri/Component/Query/ParameterTrait.php b/src/Net/Uri/Component/Query/ParameterTrait.php deleted file mode 100644 index 38d710ec..00000000 --- a/src/Net/Uri/Component/Query/ParameterTrait.php +++ /dev/null @@ -1,125 +0,0 @@ -isGroupParameter(new Parameter("fields[TYPE]", ""); // true - * $this->isGroupParameter(new Parameter("fields[]", ""); // true - * $this->isGroupParameter(new Parameter("fields", ""); // false - * - * @param string|Parameter $parameter - * - * @return bool - */ - public function isGroupParameter(string|Parameter $parameter): bool - { - $name = is_string($parameter) ? $parameter : $parameter->getName(); - return !!preg_match($this->GROUP_REGEX, $name); - } - - - /** - * Returns the name of the group if the passed string matches the grouped query parameters pattern. - * Returns null if not matching the grouped query parameter pattern. - * - * @example - * $this->getGroupName(new Parameter("fields[TYPE]", ""); // "fields" - * $this->getGroupName(new Parameter("fields[]", ""); // "fields" - * $this->getGroupName(new Parameter("fields", ""); // null - * - * @param string|Parameter $parameter - * - * @return string|null - */ - public function getGroupName(string|Parameter $parameter): ?string - { - $name = is_string($parameter) ? $parameter : $parameter->getName(); - - $found = preg_match_all( - $this->GROUP_REGEX, - $name, - $matches, - PREG_SET_ORDER, - 0 - ); - - if ($found) { - return $matches[0][1]; - } - - return null; - } - - - /** - * Returns the name of the key of the group if the passed string matches the grouped query parameters pattern. - * Returns null if not matching the grouped query parameter pattern. - * - * @example - * $this->getGroupName(new Parameter("fields[TYPE]", ""); // "TYPE" - * $this->getGroupName(new Parameter("fields", ""); // null - * - * @param string|Parameter $parameter - * - * @return string|null - */ - public function getGroupKey(string|Parameter $parameter): ?string - { - $name = is_string($parameter) ? $parameter : $parameter->getName(); - - $found = preg_match_all( - $this->GROUP_REGEX, - $name, - $matches, - PREG_SET_ORDER, - 0 - ); - - if ($found) { - return $matches[0][2] !== "" ? $matches[0][2] : null; - } - - return null; - } -} diff --git a/src/Net/Url.php b/src/Net/Url.php deleted file mode 100644 index 2be8639d..00000000 --- a/src/Net/Url.php +++ /dev/null @@ -1,54 +0,0 @@ -isAbsolute()) { - throw new MalformedUrlException( - "An URL must be an absolute URI, got \"$uri\"" - ); - } - } -} diff --git a/src/Util/AbstractList.php b/src/Util/AbstractList.php new file mode 100644 index 00000000..f2f7cc24 --- /dev/null +++ b/src/Util/AbstractList.php @@ -0,0 +1,179 @@ +getEntityType(); + + if (!$value instanceof $entityType) { + throw new TypeError( + "Expected type \"" . $entityType . "\" for value-argument" + ); + } + + if (is_null($offset)) { + $this->data[] = $value; + } else { + $this->data[$offset] = $value; + } + } + + + + /** + * @inheritdoc + */ + public function offsetExists($offset): bool + { + return isset($this->data[$offset]); + } + + + /** + * @inheritdoc + */ + public function offsetUnset($offset) + { + unset($this->data[$offset]); + } + + + /** + * @inheritdoc + */ + public function offsetGet($offset) + { + return $this->data[$offset] ?? null; + } + + +// -------------------------- +// Iterator Interface +// -------------------------- + + /** + * @inheritdoc + */ + public function rewind() + { + + $this->position = 0; + } + + /** + * @inheritdoc + */ + public function key() + { + return $this->position; + } + + /** + * @inheritdoc + */ + public function current() + { + return $this->data[$this->position]; + } + + /** + * @inheritdoc + */ + public function next() + { + $this->position++; + } + + /** + * @inheritdoc + */ + public function valid(): bool + { + return isset($this->data[$this->position]); + } + +// -------------------------- +// Iterator Interface +// -------------------------- + + /** + * @return int|void + */ + public function count() + { + return count($this->data); + } +} diff --git a/src/Core/Util/ArrayUtil.php b/src/Util/ArrayUtil.php similarity index 98% rename from src/Core/Util/ArrayUtil.php rename to src/Util/ArrayUtil.php index 027e877d..513fa28d 100644 --- a/src/Core/Util/ArrayUtil.php +++ b/src/Util/ArrayUtil.php @@ -27,12 +27,14 @@ declare(strict_types=1); -namespace Conjoon\Core\Util; +namespace Conjoon\Util; use InvalidArgumentException; /** - * Class ArrayUtil. + * Class ArrayUtil + * + * @package Conjoon\Util */ class ArrayUtil { diff --git a/src/Core/Contract/Arrayable.php b/src/Util/Arrayable.php similarity index 95% rename from src/Core/Contract/Arrayable.php rename to src/Util/Arrayable.php index f9634c8d..e10742bf 100644 --- a/src/Core/Contract/Arrayable.php +++ b/src/Util/Arrayable.php @@ -27,10 +27,11 @@ declare(strict_types=1); -namespace Conjoon\Core\Contract; +namespace Conjoon\Util; /** - * Interface Arrayable. + * Interface Arrayable + * @package Conjoon\Util */ interface Arrayable { diff --git a/src/Core/Contract/Copyable.php b/src/Util/Copyable.php similarity index 95% rename from src/Core/Contract/Copyable.php rename to src/Util/Copyable.php index 40679dad..78087222 100644 --- a/src/Core/Contract/Copyable.php +++ b/src/Util/Copyable.php @@ -27,10 +27,11 @@ declare(strict_types=1); -namespace Conjoon\Core\Contract; +namespace Conjoon\Util; /** - * Interface Copyable. + * Interface Copyable + * @package Conjoon\Util */ interface Copyable { diff --git a/src/Core/Contract/JsonDecodable.php b/src/Util/JsonDecodable.php similarity index 94% rename from src/Core/Contract/JsonDecodable.php rename to src/Util/JsonDecodable.php index 800a7b72..05b57db6 100644 --- a/src/Core/Contract/JsonDecodable.php +++ b/src/Util/JsonDecodable.php @@ -27,12 +27,11 @@ declare(strict_types=1); -namespace Conjoon\Core\Contract; - -use Conjoon\Core\Exception\JsonDecodeException; +namespace Conjoon\Util; /** - * Interface JsonDecodable. + * Interface JsonDecodable + * @package Conjoon\Util */ interface JsonDecodable { diff --git a/src/Core/Exception/JsonDecodeException.php b/src/Util/JsonDecodeException.php similarity index 93% rename from src/Core/Exception/JsonDecodeException.php rename to src/Util/JsonDecodeException.php index 4118fc6f..e5583aee 100644 --- a/src/Core/Exception/JsonDecodeException.php +++ b/src/Util/JsonDecodeException.php @@ -27,12 +27,14 @@ declare(strict_types=1); -namespace Conjoon\Core\Exception; +namespace Conjoon\Util; use RuntimeException; /** - * Error indicating that a source was not json-decodable. + * Class JsonDecodeException + * + * @package Conjoon\Util */ class JsonDecodeException extends RuntimeException { diff --git a/src/Core/Contract/JsonStrategy.php b/src/Util/JsonStrategy.php similarity index 93% rename from src/Core/Contract/JsonStrategy.php rename to src/Util/JsonStrategy.php index 3eb9692a..5c6cf5e0 100644 --- a/src/Core/Contract/JsonStrategy.php +++ b/src/Util/JsonStrategy.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Conjoon\Core\Contract; - -use Conjoon\Core\Contract\Arrayable; +namespace Conjoon\Util; /** - * Interface JsonStrategy. + * Interface JsonStrategy + * @package Conjoon\Util */ interface JsonStrategy { + /** * Returns a JSON representation of the data passed to this method. * diff --git a/src/Core/Contract/Jsonable.php b/src/Util/Jsonable.php similarity index 94% rename from src/Core/Contract/Jsonable.php rename to src/Util/Jsonable.php index 27bb9c72..700f4047 100644 --- a/src/Core/Contract/Jsonable.php +++ b/src/Util/Jsonable.php @@ -27,12 +27,11 @@ declare(strict_types=1); -namespace Conjoon\Core\Contract; - -use Conjoon\Core\Contract\JsonStrategy; +namespace Conjoon\Util; /** - * Interface Jsonable. + * Interface Jsonable + * @package Conjoon\Util */ interface Jsonable { diff --git a/src/Data/Modifiable.php b/src/Util/Modifiable.php similarity index 95% rename from src/Data/Modifiable.php rename to src/Util/Modifiable.php index d421148f..37b7d836 100644 --- a/src/Data/Modifiable.php +++ b/src/Util/Modifiable.php @@ -27,10 +27,11 @@ declare(strict_types=1); -namespace Conjoon\Data; +namespace Conjoon\Util; /** - * Interface Modifiable. + * Interface Modifiable + * @package Conjoon\Util */ interface Modifiable { diff --git a/src/Data/ModifiableTrait.php b/src/Util/ModifiableTrait.php similarity index 98% rename from src/Data/ModifiableTrait.php rename to src/Util/ModifiableTrait.php index 225b0e93..0c0b8544 100644 --- a/src/Data/ModifiableTrait.php +++ b/src/Util/ModifiableTrait.php @@ -27,7 +27,7 @@ declare(strict_types=1); -namespace Conjoon\Data; +namespace Conjoon\Util; /** * Trait ModifiableTrait. @@ -62,6 +62,8 @@ * $user = new User(); * $user->setUsername("admin"); // ;) * $user->getModifiedFields(); // ["userName"] + * + * @package Conjoon\Util */ trait ModifiableTrait { diff --git a/src/Core/Contract/Stringable.php b/src/Util/Stringable.php similarity index 85% rename from src/Core/Contract/Stringable.php rename to src/Util/Stringable.php index d91c5af8..192ef843 100644 --- a/src/Core/Contract/Stringable.php +++ b/src/Util/Stringable.php @@ -27,21 +27,18 @@ declare(strict_types=1); -namespace Conjoon\Core\Contract; - -use Conjoon\Core\Contract\StringStrategy; +namespace Conjoon\Util; /** - * Interface Stringable. + * Interface Stringable + * @package Conjoon\Util */ interface Stringable { /** * Returns a string representation of this instance. * - * @param StringStrategy|null $stringStrategy - * * @return string */ - public function toString(StringStrategy $stringStrategy = null): string; + public function toString(): string; } diff --git a/src/Web/Validation/Exception/InvalidQueryParameterValueException.php b/src/Web/Validation/Exception/InvalidQueryParameterValueException.php deleted file mode 100644 index fb68122a..00000000 --- a/src/Web/Validation/Exception/InvalidQueryParameterValueException.php +++ /dev/null @@ -1,37 +0,0 @@ -supports($obj)) { - throw new UnexpectedQueryParameterException(); - } - - /** - * @var Parameter $obj - */ - return $this->validate($obj, $errors); - } - - /** - * Contract for validating the passed QueryParameter. - * Delegated from isValid. - * - * @param Parameter $parameter - * @param ValidationErrors $errors - * - * @return bool true if validation succeeded, otherwise false - */ - abstract protected function validate(Parameter $parameter, ValidationErrors $errors): bool; -} diff --git a/src/Web/Validation/Parameter/ParameterRuleList.php b/src/Web/Validation/Parameter/ParameterRuleList.php deleted file mode 100644 index b8e2c0ee..00000000 --- a/src/Web/Validation/Parameter/ParameterRuleList.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class ParameterRuleList extends AbstractList -{ - /** - * @inheritdoc - */ - public function getEntityType(): string - { - return ParameterRule::class; - } -} diff --git a/src/Web/Validation/Parameter/Rule/IntegerValueRule.php b/src/Web/Validation/Parameter/Rule/IntegerValueRule.php deleted file mode 100644 index 82661ddb..00000000 --- a/src/Web/Validation/Parameter/Rule/IntegerValueRule.php +++ /dev/null @@ -1,176 +0,0 @@ -isValid(new Parameter("limit", "string_value"), $errors); // false - * - * // equality - * $equalsRule = new IntegerValueRule("limit", "=", 1); - * $rule->isValid(new Parameter("limit", "1"), $errors); // true - * $rule->isValid(new Parameter("limit", "123"), $errors); // false - * - * // greater than - * $equalsRule = new IntegerValueRule("limit", ">", 1); - * $rule->isValid(new Parameter("limit", "2"), $errors); // true - * $rule->isValid(new Parameter("limit", "-1"), $errors); // false - * - * // greater than or equal to - * $equalsRule = new IntegerValueRule("limit", ">=", 1); - * $rule->isValid(new Parameter("limit", "2"), $errors); // true - * $rule->isValid(new Parameter("limit", "1"), $errors); // true - * - * // less than - * $equalsRule = new IntegerValueRule("limit", "<", 1); - * $rule->isValid(new Parameter("limit", "0"), $errors); // true - * $rule->isValid(new Parameter("limit", "2"), $errors); // false - * - * // less than or equal to - * $equalsRule = new IntegerValueRule("limit", "<=", 1); - * $rule->isValid(new Parameter("limit", "-2"), $errors); // true - * $rule->isValid(new Parameter("limit", "1"), $errors); // true - * - * // not equal to - * $equalsRule = new IntegerValueRule("limit", "!=", 1); - * $rule->isValid(new Parameter("limit", "-2"), $errors); // true - * $rule->isValid(new Parameter("limit", "1"), $errors); // false - * - */ -class IntegerValueRule extends NamedParameterRule -{ - /** - * @var string|null - */ - protected ?string $operator = null; - - /** - * @var array - */ - protected array $validOperators = ["=", "!=", "<", ">", "<=", ">="]; - - /** - * @var int|null - */ - protected ?int $value = null; - - /** - * Constructor. - * If either the operator or the value is omitted, this validator will simply validate the type. - * - * @param array|string $parameterName The name of the parameter for which this rule should be applied - * @param string|null $operator Any of =, !=, <, >, <= or >= - * @param int|null $value The value that should be considered with the operator - * - * @throws InvalidArgumentException if operator is not null and not in the list of valid operators, - * or if $value is not null and not an integer - */ - public function __construct(array|string $parameterName, string $operator = null, int $value = null) - { - parent::__construct($parameterName); - - if ($operator !== null && !in_array($operator, $this->validOperators)) { - throw new InvalidArgumentException( - "operator must be one of " . - implode(", ", $this->validOperators) . - ", was: \"$operator\"" - ); - } - $this->operator = $operator; - $this->value = $value; - } - - /** - * @inheritdoc - */ - protected function validate(Parameter $parameter, ValidationErrors $errors): bool - { - $value = (int)$parameter->getValue(); - - if ((string)$value !== $parameter->getValue()) { - $errors[] = new ValidationError( - $parameter, - "parameter \"" . $parameter->getName() . "\"'s value \"" . $parameter->getValue() . - "\" cannot be treated as integer", - 400 - ); - return false; - } - - if ($this->operator === null || $this->value === null) { - return true; - } - - $res = false; - $msg = "parameter \"" . $parameter->getName() . "\"'s value \"" . $parameter->getValue() . - "\" is not " . $this->operator . " " . $this->value; - - switch ($this->operator) { - case "=": - $res = $value === $this->value; - break; - case "!=": - $res = $value !== $this->value; - break; - case ">=": - $res = $value >= $this->value; - break; - case "<=": - $res = $value <= $this->value; - break; - case ">": - $res = $value > $this->value; - break; - case "<": - $res = $value < $this->value; - break; - } - - if (!$res) { - $errors[] = new ValidationError($parameter, $msg, 400); - } - - return $res; - } -} diff --git a/src/Web/Validation/Parameter/Rule/JsonEncodedRule.php b/src/Web/Validation/Parameter/Rule/JsonEncodedRule.php deleted file mode 100644 index 219adc75..00000000 --- a/src/Web/Validation/Parameter/Rule/JsonEncodedRule.php +++ /dev/null @@ -1,60 +0,0 @@ -getValue()); - - if ($value === null) { - $error = new ValidationError( - $parameter, - "Could not decode the value " . $parameter->getValue() . " for the parameter " . $parameter->getName(), - 400 - ); - $errors[] = $error; - return false; - } - - return true; - } -} diff --git a/src/Web/Validation/Parameter/Rule/NamedParameterRule.php b/src/Web/Validation/Parameter/Rule/NamedParameterRule.php deleted file mode 100644 index ef4803e8..00000000 --- a/src/Web/Validation/Parameter/Rule/NamedParameterRule.php +++ /dev/null @@ -1,72 +0,0 @@ - - */ - protected string|array $parameterName; - - /** - * Constructor. - * - * @param string|array $parameterName The name of the parameter for which this rule should be - * applied, or an array of names so the rule can be re-used with multiple parameters - */ - public function __construct(string|array $parameterName) - { - $this->parameterName = $parameterName; - } - - - /** - * @inheritdoc - */ - public function supports(object $obj): bool - { - $names = is_array($this->parameterName) ? $this->parameterName : [$this->parameterName]; - - /** - * @var Parameter $obj - */ - return parent::supports($obj) && - in_array($obj->getName(), $names); - } -} diff --git a/src/Web/Validation/Parameter/Rule/ValueInWhitelistRule.php b/src/Web/Validation/Parameter/Rule/ValueInWhitelistRule.php deleted file mode 100644 index 54f1a936..00000000 --- a/src/Web/Validation/Parameter/Rule/ValueInWhitelistRule.php +++ /dev/null @@ -1,112 +0,0 @@ -isValid($invalid, $errors); // false - * - * $valid = new Parameter("dir", "ASC"); - * $rule->isValid($valid, $errors); // true - * - */ -class ValueInWhitelistRule extends NamedParameterRule -{ - /** - * @var array - */ - protected array $whitelist; - - - /** - * Constructor. - * - * @param array|string $parameterName The name of the parameter for which this rule should be applied - * @param array $whitelist The list of allowed values that may appear with the value of the QueryParameter - */ - public function __construct(array|string $parameterName, array $whitelist) - { - parent::__construct($parameterName); - $this->whitelist = $whitelist; - } - - /** - * @inheritdoc - */ - protected function validate(Parameter $parameter, ValidationErrors $errors): bool - { - $whitelist = $this->getWhitelist(); - if (!$this->isParameterValueValid($parameter, $whitelist)) { - $errors[] = new ValidationError( - $parameter, - "parameter \"" . $parameter->getName() . "\"'s value must validate against \"" . - implode("\", \"", $whitelist) . "\", was: \"" . $parameter->getValue() . "\"", - 400 - ); - return false; - } - - return true; - } - - - /** - * Compares $parameter with $whitelist. - * $whitelist is the array of allowed values for the parameter's value. - * Implementing APIs can use this method to transform the passed $parameter's value, if required. - * - * @param Parameter $parameter - * @param array $whitelist - * - * @return bool - */ - protected function isParameterValueValid(Parameter $parameter, array $whitelist): bool - { - return in_array($parameter->getValue(), $whitelist); - } - - /** - * @return array - */ - public function getWhitelist(): array - { - return $this->whitelist; - } -} diff --git a/src/Web/Validation/Parameter/Rule/ValuesInWhitelistRule.php b/src/Web/Validation/Parameter/Rule/ValuesInWhitelistRule.php deleted file mode 100644 index ba2de31f..00000000 --- a/src/Web/Validation/Parameter/Rule/ValuesInWhitelistRule.php +++ /dev/null @@ -1,50 +0,0 @@ - $whitelist - * @return bool - */ - protected function isParameterValueValid(Parameter $parameter, array $whitelist): bool - { - return count(array_values(array_diff(explode(",", $parameter->getValue()), $whitelist))) === 0; - } -} diff --git a/src/Web/Validation/Query/QueryRule.php b/src/Web/Validation/Query/QueryRule.php deleted file mode 100644 index 19668c0a..00000000 --- a/src/Web/Validation/Query/QueryRule.php +++ /dev/null @@ -1,80 +0,0 @@ -supports($obj)) { - throw new UnexpectedTypeException(); - } - - /** - * @var Query $obj - */ - return $this->validate($obj, $errors); - } - - /** - * Contract for validating the passed Query or parts of it. - * Delegated from isValid. - * - * @param Query $query - * @param ValidationErrors $errors - * - * @return bool true if validation succeeded, otherwise false - */ - abstract protected function validate(Query $query, ValidationErrors $errors): bool; -} diff --git a/src/Web/Validation/Query/QueryRuleList.php b/src/Web/Validation/Query/QueryRuleList.php deleted file mode 100644 index 126f43ce..00000000 --- a/src/Web/Validation/Query/QueryRuleList.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class QueryRuleList extends AbstractList -{ - /** - * @inheritdoc - */ - public function getEntityType(): string - { - return QueryRule::class; - } -} diff --git a/src/Web/Validation/Query/Rule/ExclusiveGroupKeyRule.php b/src/Web/Validation/Query/Rule/ExclusiveGroupKeyRule.php deleted file mode 100644 index e04f9948..00000000 --- a/src/Web/Validation/Query/Rule/ExclusiveGroupKeyRule.php +++ /dev/null @@ -1,117 +0,0 @@ - - */ - protected array $groups; - - /** - * @var array - */ - protected array $found; - - /** - * Constructor. - * - * @param array $groups The name of the parameter groups for which a key may not - * appear twice. - */ - public function __construct(array $groups) - { - $this->groups = $groups; - } - - - /** - * @inheritdoc - */ - protected function validate(Query $query, ValidationErrors $errors): bool - { - $parameters = $query->getAllParameters(); - - // reset/ initialize found for each run - $this->found = []; - - foreach ($parameters as $parameter) { - // skip, if not a group parameter - if (!$this->isGroupParameter($parameter)) { - continue; - } - - $name = $this->getGroupName($parameter); - - // skip, if the group parameter is not configured with *this* groups - if ($name === null || !in_array($name, $this->groups)) { - continue; - } - - $key = $this->getGroupKey($parameter); - if ($key === null) { - continue; - } - - if (!array_key_exists($key, $this->found)) { - $this->found[$key] = $name; - } else { - $errors[] = new ValidationError( - $query, - "\"$key\" must not appear in group \"$name\", since it was already " . - "configured with \"" . $this->found[$key] . "\"", - 400 - ); - - return false; - } - } - - return true; - } -} diff --git a/src/Web/Validation/Query/Rule/OnlyParameterNamesRule.php b/src/Web/Validation/Query/Rule/OnlyParameterNamesRule.php deleted file mode 100644 index e9f7ed1f..00000000 --- a/src/Web/Validation/Query/Rule/OnlyParameterNamesRule.php +++ /dev/null @@ -1,91 +0,0 @@ - - */ - private array $whitelist; - - - /** - * Constructor. - * - * @param array $whitelist A list of allowed parameter names. - */ - public function __construct(array $whitelist) - { - $this->whitelist = $whitelist; - } - - - /** - * @inheritdoc - */ - protected function validate(Query $query, ValidationErrors $errors): bool - { - $allowed = $this->getWhitelist(); - $parameters = $query->getAllParameterNames(); - $spill = array_diff($parameters, $allowed); - if (count($spill) > 0) { - $errors[] = new ValidationError( - $query, - "found additional parameters " . - "\"" . implode("\", \"", $spill) . "\"", - 400 - ); - return false; - } - - return true; - } - - - /** - * Returns the list of allowed parameter names. - * - * @return array - */ - public function getWhitelist(): array - { - return $this->whitelist; - } -} diff --git a/src/Web/Validation/Query/Rule/RequiredParameterNamesRule.php b/src/Web/Validation/Query/Rule/RequiredParameterNamesRule.php deleted file mode 100644 index fc8a39f2..00000000 --- a/src/Web/Validation/Query/Rule/RequiredParameterNamesRule.php +++ /dev/null @@ -1,90 +0,0 @@ - - */ - private array $required; - - - /** - * Constructor. - * - * @param array $required A list of required parameter names. - */ - public function __construct(array $required) - { - $this->required = $required; - } - - - /** - * @inheritdoc - */ - protected function validate(Query $query, ValidationErrors $errors): bool - { - $allowed = $this->getRequired(); - $parameters = $query->getAllParameterNames(); - $spill = array_diff($allowed, $parameters); - if (count($spill) > 0) { - $errors[] = new ValidationError( - $query, - "required parameters missing " . - "\"" . implode("\", \"", $spill) . "\"", - 400 - ); - return false; - } - - return true; - } - - - /** - * Returns the list of required parameter names. - * - * @return array - */ - public function getRequired(): array - { - return $this->required; - } -} diff --git a/src/Web/Validation/QueryValidator.php b/src/Web/Validation/QueryValidator.php deleted file mode 100644 index d819fcea..00000000 --- a/src/Web/Validation/QueryValidator.php +++ /dev/null @@ -1,129 +0,0 @@ -supports($obj)) { - throw new UnexpectedQueryException( - "query is not supported by this validator" - ); - } - - foreach ($this->getQueryRules($obj) as $queryRule) { - $queryRule->isValid($obj, $errors); - } - - $parameters = $obj->getAllParameters(); - - foreach ($this->getParameterRules($obj) as $parameterRule) { - $parameters->map( - fn ($parameter) => $parameterRule->supports($parameter) - ? $parameterRule->isValid($parameter, $errors) - : null - ); - } - } - - - /** - * Returns the ParameterRules for the specified Query. - * - * @param Query $query - * - * @return ParameterRuleList - */ - abstract public function getParameterRules(Query $query): ParameterRuleList; - - - /** - * Returns the QueryRules for the specified Query. - * - * @param Query $query - * - * @return QueryRuleList - */ - abstract public function getQueryRules(Query $query): QueryRuleList; - - - /** - * Returns a list of parameter names that must be available with the Query. - * - * @param Query $query - * @return array - */ - abstract public function getRequiredParameterNames(Query $query): array; - - - /** - * Returns a list of allowed parameter names that must appear exclusively with the - * query. - * - * @return array - */ - abstract public function getAllowedParameterNames(Query $query): array; -} diff --git a/tests/Core/AbstractListTest.php b/tests/Core/AbstractListTest.php deleted file mode 100644 index 257fa69c..00000000 --- a/tests/Core/AbstractListTest.php +++ /dev/null @@ -1,275 +0,0 @@ -getMockForAbstractList(); - $this->assertSame(stdClass::class, $abstractList->getEntityType()); - $this->assertInstanceOf(Countable::class, $abstractList); - $this->assertInstanceOf(ArrayAccess::class, $abstractList); - $this->assertInstanceOf(Iterator::class, $abstractList); - } - - /** - * Tests OutOfBoundsException /w string as key - * @return void - */ - public function testOffsetSetWithStringAndOutOfBoundsException(): void - { - $this->expectException(OutOfBoundsException::class); - - $abstractList = $this->getMockForAbstractList(); - $abstractList["1"] = new stdClass(); - } - - - /** - * Tests ArrayAccess /w type exception - * @return void - */ - public function testArrayAccessException(): void - { - $this->expectException(TypeError::class); - - $abstractList = $this->getMockForAbstractList(); - $abstractList[] = "foo"; - } - - - /** - * Tests ArrayAccess - * @return void - */ - public function testArrayAccessAndCountable(): void - { - $abstractList = $this->getMockForAbstractList(); - - $cmpList = [ - new stdClass(), - new stdClass() - ]; - - $abstractList[] = $cmpList[0]; - $abstractList[] = $cmpList[1]; - - $this->assertSame(2, count($abstractList)); - - foreach ($abstractList as $key => $item) { - $this->assertSame($cmpList[$key], $item); - } - } - - - /** - * Tests Arrayable - * @return void - */ - public function testToArray(): void - { - $abstractList = $this->getMockForAbstractList(); - - $cmpList = [ - new stdClass(), - new stdClass() - ]; - - $abstractList[] = $cmpList[0]; - $abstractList[] = $cmpList[1]; - - $this->assertEquals([ - $abstractList[0], - $abstractList[1] - ], $abstractList->toArray()); - } - - - /** - * Tests map() - * @return void - */ - public function testMap(): void - { - $abstractList = $this->getMockForAbstractList(); - - $cmpList = [ - new stdClass(), - new stdClass() - ]; - - $cmpList[0]->foo = 1; - $cmpList[0]->bar = 2; - $cmpList[1]->foo = 3; - $cmpList[1]->bar = 4; - - $abstractList[] = $cmpList[0]; - $abstractList[] = $cmpList[1]; - - $mock = $this->getMockBuilder(stdClass::class) - ->addMethods(["mapCallback"])->getMock(); - - $mock->expects($this->exactly(2)) - ->method("mapCallback")->withConsecutive([$cmpList[0]], [$cmpList[1]]) - ->willReturnOnConsecutiveCalls($cmpList[0]->foo * 2, $cmpList[1]->foo * 2); - - - /** @phpstan-ignore-next-line */ - $cb = $mock->mapCallback(...); - $this->assertEquals( - [2, 6], - $abstractList->map($cb) - ); - } - - - /** - * Tests findBy() - * @return void - */ - public function testFindBy(): void - { - $abstractList = $this->getMockForAbstractList(); - - $cmpList = [ - new stdClass(), - new stdClass() - ]; - - $cmpList[0]->foo = 1; - $cmpList[0]->bar = 2; - $cmpList[1]->foo = 3; - $cmpList[1]->bar = 4; - - $abstractList[] = $cmpList[0]; - $abstractList[] = $cmpList[1]; - - $mock = $this->getMockBuilder(stdClass::class) - ->addMethods(["findCallback"])->getMock(); - - $mock->expects($this->exactly(2)) - ->method("findCallback")->withConsecutive([$cmpList[0]], [$cmpList[1]]) - ->willReturnOnConsecutiveCalls(false, true); - - /** @phpstan-ignore-next-line */ - $cb = $mock->findCallback(...); - $this->assertSame( - $cmpList[1], - $abstractList->findBy($cb) - ); - } - - /** - * Tests peek() - * @return void - */ - public function testPeek(): void - { - $abstractList = $this->getMockForAbstractList(); - - $this->assertNull($abstractList->peek()); - - $one = new stdClass(); - $two = new stdClass(); - - $abstractList[] = $one; - $abstractList[] = $two; - - $this->assertSame($two, $abstractList->peek()); - } - - - /** - * Tests make() - * @return void - */ - public function testMake(): void - { - $abstractList = new class extends AbstractList { - public function getEntityType(): string - { - return stdClass::class; - } - }; - - $one = new stdClass(); - $two = new stdClass(); - - $list = $abstractList::make($one, $two); - - $this->assertInstanceOf($abstractList::class, $list); - - $this->assertSame($list[0], $one); - $this->assertSame($list[1], $two); - } - - -// --------------------- -// Helper Functions -// --------------------- - - /** - * @return MockObject&AbstractList - */ - protected function getMockForAbstractList(): AbstractList&MockObject - { - - $mock = $this->getMockForAbstractClass(AbstractList::class); - $mock->expects($this->any()) - ->method("getEntityType") - ->will($this->returnValue(stdClass::class)); - - return $mock; - } -} diff --git a/tests/Core/Exception/ClassNotFoundExceptionTest.php b/tests/Core/Exception/ClassNotFoundExceptionTest.php deleted file mode 100644 index 33c52d8e..00000000 --- a/tests/Core/Exception/ClassNotFoundExceptionTest.php +++ /dev/null @@ -1,47 +0,0 @@ -assertInstanceOf(RuntimeException::class, $exception); - } -} diff --git a/tests/Core/Exception/InvalidTypeExceptionTest.php b/tests/Core/Exception/InvalidTypeExceptionTest.php deleted file mode 100644 index 3eec04a0..00000000 --- a/tests/Core/Exception/InvalidTypeExceptionTest.php +++ /dev/null @@ -1,47 +0,0 @@ -assertInstanceOf(RuntimeException::class, $exception); - } -} diff --git a/tests/Core/Exception/UnexpectedTypeExceptionTest.php b/tests/Core/Exception/UnexpectedTypeExceptionTest.php deleted file mode 100644 index cd48b49b..00000000 --- a/tests/Core/Exception/UnexpectedTypeExceptionTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertInstanceOf(RuntimeException::class, $exception); - } -} diff --git a/tests/Data/ParameterBagTest.php b/tests/Core/ParameterBagTest.php similarity index 97% rename from tests/Data/ParameterBagTest.php rename to tests/Core/ParameterBagTest.php index 3261100c..74025bfd 100644 --- a/tests/Data/ParameterBagTest.php +++ b/tests/Core/ParameterBagTest.php @@ -27,10 +27,10 @@ declare(strict_types=1); -namespace Tests\Conjoon\Core\Data; +namespace Tests\Conjoon\Core; -use Conjoon\Data\ParameterBag; -use Conjoon\Core\Contract\Jsonable; +use Conjoon\Core\ParameterBag; +use Conjoon\Util\Jsonable; use BadMethodCallException; use InvalidArgumentException; use Tests\TestCase; diff --git a/tests/Data/Resource/ResourceQueryTest.php b/tests/Core/ResourceQueryTest.php similarity index 70% rename from tests/Data/Resource/ResourceQueryTest.php rename to tests/Core/ResourceQueryTest.php index 18ec2619..fd3b600e 100644 --- a/tests/Data/Resource/ResourceQueryTest.php +++ b/tests/Core/ResourceQueryTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\Data\Resource; +namespace Tests\Conjoon\Core; +use Conjoon\Core\ParameterBag; use BadMethodCallException; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\Data\ParameterBag; -use Conjoon\Data\Resource\ResourceQuery; +use Conjoon\Core\ResourceQuery; +use Conjoon\Util\Jsonable; use PHPUnit\Framework\MockObject\MockObject; use Tests\TestCase; /** - * Tests ResourceQuery + * Class ResourceQueryTest + * @package Tests\Conjoon\Core */ class ResourceQueryTest extends TestCase { @@ -47,7 +47,7 @@ class ResourceQueryTest extends TestCase * @noinspection PhpUndefinedFieldInspection * @noinspection PhpUndefinedMethodInspection */ - public function testDelegates(): void + public function testDelegates() { $bag = $this ->getMockBuilder(ParameterBag::class) @@ -82,9 +82,7 @@ public function testDelegates(): void ["some" ] )->willReturnOnConsecutiveCalls(1, 2, null); - /** - * @var ResourceQuery $resourceQuery - */ + $resourceQuery = $this->getResourceQuery($bag); $this->assertInstanceOf(Jsonable::class, $resourceQuery); @@ -97,12 +95,8 @@ public function testDelegates(): void $this->assertSame(2, $resourceQuery->getString("foo")); $this->assertNull($resourceQuery->getBool("some")); - /** @see https://github.com/phpstan/phpstan/discussions/4901 */ - /** @phpstan-ignore-next-line */ $this->assertSame(1, $resourceQuery->bar); - /** @phpstan-ignore-next-line */ $this->assertSame(2, $resourceQuery->foo); - /** @phpstan-ignore-next-line */ $this->assertNull($resourceQuery->some); } @@ -111,45 +105,18 @@ public function testDelegates(): void * No method available * @noinspection PhpUndefinedMethodInspection */ - public function testDelegateCallException(): void + public function testDelegateCallException() { $this->expectException(BadMethodCallException::class); - /** @phpstan-ignore-next-line */ $this->getResourceQuery(new ParameterBag())->getSomeThing("d"); } - /** - * tests toJson() - */ - public function testToJsonWithStrategy(): void - { - $json = []; - $bag = $this - ->getMockBuilder(ParameterBag::class) - ->disableOriginalConstructor() - ->onlyMethods(["toJson"])->getMock(); - - /** - * @var MockObject&JsonStrategy $strategy - */ - $strategy = $this->createMockForAbstract(JsonStrategy::class); - - $query = $this->getResourceQuery($bag); - - $bag->expects($this->exactly(2)) - ->method("toJson") - ->withConsecutive([$strategy], [null])->willReturnOnConsecutiveCalls($json, []); - - $this->assertSame($json, $query->toJson($strategy)); - $this->assertSame([], $query->toJson()); - } - /** * @param ParameterBag $bag - * @return ResourceQuery&MockObject + * @return ResourceQuery|MockObject */ - protected function getResourceQuery(ParameterBag $bag): MockObject&ResourceQuery + protected function getResourceQuery(ParameterBag $bag) { return $this->getMockForAbstractClass( ResourceQuery::class, diff --git a/tests/Core/Util/ClassLoaderTest.php b/tests/Core/Util/ClassLoaderTest.php deleted file mode 100644 index 7717281e..00000000 --- a/tests/Core/Util/ClassLoaderTest.php +++ /dev/null @@ -1,120 +0,0 @@ -expectException(ClassNotFoundException::class); - - $loader = new ClassLoader(); - - $loader->load("RandomClass", "RandomParentClass"); - } - - - /** - * tests load() with InvalidTypeException - */ - public function testGetResourceTargetWithInvalidTypeException() - { - $this->expectException(InvalidTypeException::class); - - $loader = new ClassLoader(); - - $loader->load("Tests\\Conjoon\\Data\\Resource\\TestResourceStd", "Conjoon\\Core"); - } - - /** - * tests load() - */ - public function testLoad() - { - $loader = new ClassLoader(); - - $this->assertSame( - "Tests\\Conjoon\\Data\\Resource\\TestResourceObjectDescription", - $loader->load( - "Tests\\Conjoon\\Data\\Resource\\TestResourceObjectDescription", - "Conjoon\\Data\\Resource\\ObjectDescription" - ) - ); - } - - - /** - * tests create() - */ - public function testGetResourceTarget() - { - $loader = new ClassLoader(); - - $inst = $loader->create( - "Tests\\Conjoon\\Data\\Resource\\TestResourceObjectDescription", - "Conjoon\\Data\\Resource\\ObjectDescription" - ); - $this->assertNull($inst->getOne()); - $this->assertNull($inst->getTwo()); - $this->assertNull($inst->getThree()); - - $this->assertInstanceOf( - "Tests\\Conjoon\\Data\\Resource\\TestResourceObjectDescription", - $inst - ); - - $loader = new ClassLoader(); - - $inst = $loader->create( - "Tests\\Conjoon\\Data\\Resource\\TestResourceObjectDescription", - "Conjoon\\Data\\Resource\\ObjectDescription", - [1, 2, 3] - ); - $this->assertSame(1, $inst->getOne()); - $this->assertSame(2, $inst->getTwo()); - $this->assertSame(3, $inst->getThree()); - - $this->assertInstanceOf( - "Tests\\Conjoon\\Data\\Resource\\TestResourceObjectDescription", - $inst - ); - } -} diff --git a/tests/Data/Filter/FilterTest.php b/tests/Data/Filter/FilterTest.php deleted file mode 100644 index c7d4ca2f..00000000 --- a/tests/Data/Filter/FilterTest.php +++ /dev/null @@ -1,71 +0,0 @@ -assertInstanceOf(Stringable::class, $filter); - $this->assertSame($expr, $filter->getExpression()); - } - - - /** - * Tests toString() - */ - public function testToString() - { - $expr = $this->createMockForAbstract(Expression::class, ["toString"]); - $expr->expects($this->once())->method("toString")->willReturn("string"); - - $filter = new Filter($expr); - $this->assertSame("string", $filter->toString()); - } -} diff --git a/tests/Data/Resource/ObjectDescriptionListTest.php b/tests/Data/Resource/ObjectDescriptionListTest.php deleted file mode 100644 index 989a8396..00000000 --- a/tests/Data/Resource/ObjectDescriptionListTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertInstanceOf(AbstractList::class, $list); - $this->assertSame(ObjectDescription::class, $list->getEntityType()); - } -} diff --git a/tests/Data/Resource/ObjectDescriptionTest.php b/tests/Data/Resource/ObjectDescriptionTest.php deleted file mode 100644 index b2af0e72..00000000 --- a/tests/Data/Resource/ObjectDescriptionTest.php +++ /dev/null @@ -1,273 +0,0 @@ -getObjectDescriptionMock(); - - $this->assertInstanceOf(ObjectDescription::class, $resource); - } - - - /** - * tests getAllRelationshipTypes() - * @return void - * @throws ReflectionException - */ - public function testGetAllRelationshipTypes(): void - { - $translator = $this->getObjectDescriptionMock(["getAllRelationshipResourceDescriptions"]); - $reflection = new ReflectionClass($translator); - - $resourceTarget = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget->expects($this->exactly(1))->method("getType")->willReturn("entity"); - $resourceTarget_1 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_1->expects($this->exactly(2))->method("getType")->willReturn("entity_1"); - $resourceTarget_2 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_2->expects($this->exactly(2))->method("getType")->willReturn("entity_2"); - - $relationships1 = new ObjectDescriptionList(); - $relationships1[] = $resourceTarget_1; - $relationships1[] = $resourceTarget_2; - - $relationships2 = new ObjectDescriptionList(); - $relationships2[] = $resourceTarget; - $relationships2[] = $resourceTarget_1; - $relationships2[] = $resourceTarget_2; - - $translator - ->expects($this->exactly(2)) - ->method("getAllRelationshipResourceDescriptions") - ->withConsecutive([false], [true]) - ->willReturnOnConsecutiveCalls( - $relationships1, - $relationships2, - ); - - - $getAllRelationshipTypes = $reflection->getMethod("getAllRelationshipTypes"); - $getAllRelationshipTypes->setAccessible(true); - - $this->assertEquals([ - "entity_1", "entity_2" - ], $getAllRelationshipTypes->invokeArgs($translator, [])); - - $this->assertEquals([ - "entity", "entity_1", "entity_2" - ], $getAllRelationshipTypes->invokeArgs($translator, [true])); - } - - - /** - * tests getAllRelationshipPaths() with dot-notation - * @return void - * @throws ReflectionException - */ - public function testGetAllRelationshipPaths(): void - { - $relationships = new ObjectDescriptionList(); - - $resourceTarget = $this->getObjectDescriptionMock([ - "getRelationships", - "getAllRelationshipResourceDescriptions" - ]); - $resourceTarget->expects($this->any())->method("getType")->willReturn("entity"); - $resourceTarget->expects($this->any())->method("getRelationships")->willReturn($relationships); - $reflection = new ReflectionClass($resourceTarget); - - - $relationships_1 = new ObjectDescriptionList(); - $relationships_1_1 = new ObjectDescriptionList(); - $relationships_1_2 = new ObjectDescriptionList(); - - - $resourceTarget_1 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_1->expects($this->any())->method("getType")->willReturn("entity_1"); - $resourceTarget_1->expects($this->any())->method("getRelationships")->willReturn($relationships_1); - - $resourceTarget_1_1 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_1_1->expects($this->any())->method("getType")->willReturn("entity_1_1"); - $resourceTarget_1_1->expects($this->any())->method("getRelationships")->willReturn($relationships_1_1); - - $resourceTarget_1_2 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_1_2->expects($this->any())->method("getType")->willReturn("entity_1_2"); - $resourceTarget_1_2->expects($this->any())->method("getRelationships")->willReturn($relationships_1_2); - - $resourceTarget_1_1_1 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_1_1_1->expects($this->any())->method("getType")->willReturn("entity_1_1_1"); - - $resourceTarget_1_2_1 = $this->getObjectDescriptionMock(["getRelationships"]); - $resourceTarget_1_2_1->expects($this->any())->method("getType")->willReturn("entity_1_2_1"); - - $relationships[] = $resourceTarget_1; - $relationships_1[] = $resourceTarget_1_1; - $relationships_1[] = $resourceTarget_1_2; - $relationships_1_1[] = $resourceTarget_1_1_1; - $relationships_1_2[] = $resourceTarget_1_2_1; - - - /** - * [ - * "entity", - * "entity_1", - * "entity_1.entity_1_1", - * "entity_1.entity_1_1.entity_1_1_1", - * "entity_1.entity_1_2", - * "entity_1.entity_1_2.entity_1_2_1" - * ] - */ - - $getAllRelationshipPaths = $reflection->getMethod("getAllRelationshipPaths"); - $getAllRelationshipPaths->setAccessible(true); - - $this->assertEquals([ - "entity", - "entity.entity_1", - "entity.entity_1.entity_1_1", - "entity.entity_1.entity_1_1.entity_1_1_1", - "entity.entity_1.entity_1_2", - "entity.entity_1.entity_1_2.entity_1_2_1" - ], $getAllRelationshipPaths->invokeArgs($resourceTarget, [true])); - - $this->assertEquals([ - "entity_1", - "entity_1.entity_1_1", - "entity_1.entity_1_1.entity_1_1_1", - "entity_1.entity_1_2", - "entity_1.entity_1_2.entity_1_2_1" - ], $getAllRelationshipPaths->invokeArgs($resourceTarget, [false])); - } - - - - /** - * Tests getAllRelationshipResourceDescriptions - * @return void - */ - public function testGetAllRelationshipResourceDescriptions(): void - { - $resourceTarget = $this->getObjectDescriptionMock(["getRelationships"], "A"); - - $resourceTarget_1_1 = $this->getObjectDescriptionMock(["getRelationships"], "B"); - $resourceTarget_1_2 = $this->getObjectDescriptionMock(["getRelationships"], "C"); - $resourceTarget_2_1 = $this->getObjectDescriptionMock(["getRelationships"], "D"); - - $relationships = new ObjectDescriptionList(); - $relationships[] = $resourceTarget_1_1; - $relationships[] = $resourceTarget_1_2; - - $relationships_1_1 = new ObjectDescriptionList(); - $relationships_1_1[] = $resourceTarget_2_1; - - $relationships_1_2 = new ObjectDescriptionList(); - $relationships_2_1 = new ObjectDescriptionList(); - - $callTimes = 2; - - - $resourceTarget->expects($this->exactly($callTimes))->method("getRelationships")->willReturn( - $relationships - ); - - $resourceTarget_1_1->expects($this->exactly($callTimes))->method("getRelationships")->willReturn( - $relationships_1_1 - ); - $resourceTarget_1_2->expects($this->exactly($callTimes))->method("getRelationships")->willReturn( - $relationships_1_2 - ); - $resourceTarget_2_1->expects($this->exactly($callTimes))->method("getRelationships")->willReturn( - $relationships_2_1 - ); - - - $list = $resourceTarget->getAllRelationshipResourceDescriptions(); - foreach ( - [ - $resourceTarget_1_1, $resourceTarget_1_2, $resourceTarget_2_1 - ] as $resourceObject - ) { - $this->assertContains($resourceObject, $list); - } - - $list = $resourceTarget->getAllRelationshipResourceDescriptions(true); - foreach ( - [ - $resourceTarget, $resourceTarget_1_1, $resourceTarget_1_2, $resourceTarget_2_1 - ] as $resourceObject - ) { - $this->assertContains($resourceObject, $list); - } - } - - - /** - * @param array $methods - * @param string $type - * @return MockObject&ObjectDescription - */ - protected function getObjectDescriptionMock( - array $methods = [], - string $type = "" - ): MockObject&ObjectDescription { - if (!in_array("getType", $methods)) { - $methods[] = "getType"; - } - - /** - * @var MockObject&ObjectDescription $mock - */ - $mock = $this->createMockForAbstract( - ObjectDescription::class, - $methods - ); - - if ($type !== "") { - $mock->expects($this->any())->method("getType")->willReturn($type); - } - - return $mock; - } -} diff --git a/tests/Data/Resource/TestResourceObjectDescription.php b/tests/Data/Resource/TestResourceObjectDescription.php deleted file mode 100644 index 7a428d56..00000000 --- a/tests/Data/Resource/TestResourceObjectDescription.php +++ /dev/null @@ -1,91 +0,0 @@ -one = $one; - $this->two = $two; - $this->three = $three; - } - - public function getPath(): Template - { - return new Template("/path/{id}"); - } - - public function getOne(): ?int - { - return $this->one; - } - - public function getTwo(): ?int - { - return $this->two; - } - - public function getThree(): ?int - { - return $this->three; - } - - public function getType(): string - { - return ""; - } - - public function getRelationships(): ObjectDescriptionList - { - return new ObjectDescriptionList(); - } - - public function getFields(): array - { - return []; - } - - public function getDefaultFields(): array - { - return []; - } -} diff --git a/tests/Data/Resource/TestResourceStd.php b/tests/Data/Resource/TestResourceStd.php deleted file mode 100644 index cc5dc4d6..00000000 --- a/tests/Data/Resource/TestResourceStd.php +++ /dev/null @@ -1,37 +0,0 @@ -assertEqualsCanonicalizing( - [SortDirection::ASC, SortDirection::DESC], - SortDirection::cases() - ); - - $this->assertSame("ascending", SortDirection::ASC->value); - $this->assertSame("descending", SortDirection::DESC->value); - } -} diff --git a/tests/Data/Sort/SortInfoListTest.php b/tests/Data/Sort/SortInfoListTest.php deleted file mode 100644 index bd248cb5..00000000 --- a/tests/Data/Sort/SortInfoListTest.php +++ /dev/null @@ -1,110 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - $this->assertInstanceOf(Jsonable::class, $list); - - $this->assertSame(SortInfo::class, $list->getEntityType()); - } - - - /** - * Tests toArray() - */ - public function testToArray() - { - $list = $this->createList(); - - $entry1 = $this->createMockForAbstract( - SortInfo::class, - ["toArray"], - ["subject", SortDirection::ASC] - ); - $entry1->expects($this->once())->method("toArray")->willReturn([]); - $entry2 = $this->createMockForAbstract( - SortInfo::class, - ["toArray"], - ["subject", SortDirection::ASC] - ); - $entry2->expects($this->once())->method("toArray")->willReturn([]); - - $list[] = $entry1; - $list[] = $entry2; - - $this->assertEquals([ - [], [] - ], $list->toArray()); - } - - - /** - * Tests toJson() - */ - public function testToJson() - { - $this->runToJsonTest($this->createMockForAbstract(SortInfoList::class)); - } - - - /** - * @return SortInfoList - */ - protected function createList(): SortInfoList - { - return new SortInfoList(); - } -} diff --git a/tests/Data/Sort/SortInfoTest.php b/tests/Data/Sort/SortInfoTest.php deleted file mode 100644 index 60d07bb7..00000000 --- a/tests/Data/Sort/SortInfoTest.php +++ /dev/null @@ -1,76 +0,0 @@ -assertInstanceOf(Jsonable::class, $sort); - $this->assertSame("subject", $sort->getField()); - $this->assertSame(SortDirection::ASC, $sort->getDirection()); - - - $this->assertSame([ - "field" => "subject", - "direction" => SortDirection::ASC->value - ], $sort->toArray()); - } - - - /** - * Tests toJson() - */ - public function testToJson() - { - $this->runToJsonTest( - $this->createMockForAbstract(SortInfo::class, [], ["subject", SortDirection::ASC]) - ); - } -} diff --git a/tests/Data/Validation/ValidationErrorTest.php b/tests/Data/Validation/ValidationErrorTest.php deleted file mode 100644 index aa61442a..00000000 --- a/tests/Data/Validation/ValidationErrorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -createError(); - $this->assertInstanceOf(AbstractError::class, $error); - } - - - /** - * tests toJson - * @return void - */ - public function testToJson(): void - { - $this->runToJsonTest($this->createError()); - } - - - /** - * @return ValidationError - */ - protected function createError(): ValidationError - { - return new ValidationError(new stdClass()); - } -} diff --git a/tests/Data/Validation/ValidationErrorsTest.php b/tests/Data/Validation/ValidationErrorsTest.php deleted file mode 100644 index 37ec5f6d..00000000 --- a/tests/Data/Validation/ValidationErrorsTest.php +++ /dev/null @@ -1,74 +0,0 @@ -createList(); - $this->assertInstanceOf(ErrorObjectList::class, $list); - $this->assertSame(ValidationError::class, $list->getEntityType()); - } - - - /** - * tests toJson - * @return void - */ - public function testToJson(): void - { - $this->runToJsonTest($this->createList()); - } - - - /** - * @return Errors - */ - protected function createList(): ValidationErrors - { - $list = new ValidationErrors(); - return $list; - } -} diff --git a/tests/Error/AbstractErrorTest.php b/tests/Error/AbstractErrorTest.php deleted file mode 100644 index fcd0c2cb..00000000 --- a/tests/Error/AbstractErrorTest.php +++ /dev/null @@ -1,77 +0,0 @@ -createMockForAbstract(ErrorSource::class); - $error = $this->createMockForAbstract(AbstractError::class, [], [ - $errorSource, - "detail", - 500 - ]); - - $this->assertInstanceOf(ErrorObject::class, $error); - $this->assertSame($errorSource, $error->getSource()); - $this->assertSame("detail", $error->getDetails()); - $this->assertSame(500, $error->getCode()); - - $std = new stdClass(); - $error = $this->createMockForAbstract(AbstractError::class, [], [ - $std - ]); - $this->assertSame("", $error->getDetails()); - $this->assertSame(0, $error->getCode()); - - $this->assertInstanceOf(AnonymousErrorSource::class, $error->getSource()); - $this->assertSame($std, $error->getSource()->getSource()); - - $this->assertEquals([ - "source" => $error->getSource()->toArray(), - "detail" => $error->getDetails(), - "code" => $error->getCode() - ], $error->toArray()); - } -} diff --git a/tests/Error/AnonymousErrorSourceTest.php b/tests/Error/AnonymousErrorSourceTest.php deleted file mode 100644 index 457f231f..00000000 --- a/tests/Error/AnonymousErrorSourceTest.php +++ /dev/null @@ -1,86 +0,0 @@ -createMockForAbstract(AnonymousErrorSource::class, [], [$obj]); - $this->assertInstanceOf(ErrorSource::class, $anon); - - $this->assertSame( - "anonymous<" . - str_replace("\n", "", print_r($obj, true)) . - ">", - $anon->getName() - ); - - $this->assertSame( - ["pointer" => $anon->getName()], - $anon->toArray() - ); - - $this->assertSame( - $obj, - $anon->getSource() - ); - - $this->assertSame( - $anon->getName(), - $anon->toString() - ); - } - - - /** - * Tests toString() - */ - public function testToString() - { - $this->runToStringTest(AnonymousErrorSource::class); - } -} diff --git a/tests/Error/ErrorObjectListTest.php b/tests/Error/ErrorObjectListTest.php deleted file mode 100644 index 615fdc70..00000000 --- a/tests/Error/ErrorObjectListTest.php +++ /dev/null @@ -1,89 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - $this->assertSame(ErrorObject::class, $list->getEntityType()); - } - - - /** - * Tests hasError - */ - public function testHasError() - { - $list = $this->createList(); - $this->assertFalse($list->hasError()); - - $list[] = $this->createMockForAbstract(ErrorObject::class); - $this->assertTrue($list->hasError()); - } - - - /** - * tests toArray() - * @return void - */ - public function testToArray(): void - { - $list = $this->createList(); - - $error = $this->createMockForAbstract(ErrorObject::class, ["toArray"]); - $error->expects($this->once())->method("toArray")->willReturn([]); - $list[] = $error; - - $this->assertSame([[]], $list->toArray()); - } - - - /** - * @return Errors - */ - protected function createList(): ErrorObjectList - { - return new ErrorObjectList(); - } -} diff --git a/tests/Error/ErrorObjectTest.php b/tests/Error/ErrorObjectTest.php deleted file mode 100644 index 514a0f67..00000000 --- a/tests/Error/ErrorObjectTest.php +++ /dev/null @@ -1,49 +0,0 @@ -createMockForAbstract(ErrorObject::class); - $this->assertInstanceOf(Arrayable::class, $error); - } -} diff --git a/tests/Error/ErrorSourceTest.php b/tests/Error/ErrorSourceTest.php deleted file mode 100644 index 580ee414..00000000 --- a/tests/Error/ErrorSourceTest.php +++ /dev/null @@ -1,52 +0,0 @@ -createMockForAbstract(ErrorSource::class); - - $this->assertInstanceOf(Stringable::class, $errorSource); - $this->assertInstanceOf(Arrayable::class, $errorSource); - } -} diff --git a/tests/Horde_Imap/Client/AttachmentComposerForTesting.php b/tests/Horde/Mail/Client/Imap/AttachmentComposerForTesting.php similarity index 93% rename from tests/Horde_Imap/Client/AttachmentComposerForTesting.php rename to tests/Horde/Mail/Client/Imap/AttachmentComposerForTesting.php index 69be1035..e418fb80 100644 --- a/tests/Horde_Imap/Client/AttachmentComposerForTesting.php +++ b/tests/Horde/Mail/Client/Imap/AttachmentComposerForTesting.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; /** * Class AttachmentComposerForTesting - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ class AttachmentComposerForTesting { diff --git a/tests/Horde_Imap/Client/AttachmentTraitForTesting.php b/tests/Horde/Mail/Client/Imap/AttachmentTraitForTesting.php similarity index 94% rename from tests/Horde_Imap/Client/AttachmentTraitForTesting.php rename to tests/Horde/Mail/Client/Imap/AttachmentTraitForTesting.php index 30b62efa..796fa3c5 100644 --- a/tests/Horde_Imap/Client/AttachmentTraitForTesting.php +++ b/tests/Horde/Mail/Client/Imap/AttachmentTraitForTesting.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; -use Conjoon\Horde_Imap\Client\AttachmentTrait; +use Conjoon\Horde\Mail\Client\Imap\AttachmentTrait; /** * Class AttachmentTraitForTesting - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ class AttachmentTraitForTesting { diff --git a/tests/Horde_Imap/Client/AttachmentTraitTest.php b/tests/Horde/Mail/Client/Imap/AttachmentTraitTest.php similarity index 96% rename from tests/Horde_Imap/Client/AttachmentTraitTest.php rename to tests/Horde/Mail/Client/Imap/AttachmentTraitTest.php index 84b4854c..049d9f41 100644 --- a/tests/Horde_Imap/Client/AttachmentTraitTest.php +++ b/tests/Horde/Mail/Client/Imap/AttachmentTraitTest.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; - -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\Flag\DraftFlag; -use Conjoon\MailClient\Message\Flag\FlagList; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; + +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\Flag\DraftFlag; +use Conjoon\Mail\Client\Message\Flag\FlagList; use Horde_Imap_Client_Socket; use Horde_Mime_Headers; use Horde_Mime_Part; @@ -46,7 +46,7 @@ /** * Class FilterTraitTest - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ class AttachmentTraitTest extends TestCase { @@ -345,7 +345,7 @@ public function testDeleteAttachment() $result = $trait->deleteAttachment($attachmentKey); - $this->assertEquals($newMessageKey->toArray(), $result->toArray()); + $this->assertEquals($newMessageKey->toJson(), $result->toJson()); } diff --git a/tests/Horde/Mail/Client/Imap/AttributeTraitTest.php b/tests/Horde/Mail/Client/Imap/AttributeTraitTest.php new file mode 100644 index 00000000..1469bede --- /dev/null +++ b/tests/Horde/Mail/Client/Imap/AttributeTraitTest.php @@ -0,0 +1,182 @@ +getMockedTrait(); + + $defs = array_map(fn ($item) => true, array_flip($client->getDefaultAttributes())); + + $reflection = new ReflectionClass($client); + $property = $reflection->getMethod("getDefAttr"); + $property->setAccessible(true); + + $this->assertEquals( + $defs, + $property->invokeArgs($client, []) + ); + + $this->assertEquals( + array_merge($defs, ["foo" => true]), + $property->invokeArgs($client, [["foo" => []]]) + ); + + $this->assertEquals( + array_merge($defs, ["foo" => ["length" => 3]]), + $property->invokeArgs($client, [["foo" => ["length" => 3]]]) + ); + + $this->assertEquals( + $defs, + $property->invokeArgs($client, [["foo" => false]]) + ); + } + + /** + * getSupportedAttributes() + */ + public function testGetSupportedAttributes() + { + $client = $this->getMockedTrait(); + $this->assertEquals([ + "hasAttachments", + "size", + "plain", // \ __Preview + "html", // / Text + "cc", + "bcc", + "replyTo", + "from", + "to", + "subject", + "date", + "seen", + "answered", + "draft", + "flagged", + "recent", + "charset", + "references", + "messageId" + ], $client->getSupportedAttributes()); + } + + + /** + * getDefaultAttributes() + */ + public function testGetDefaultAttributes() + { + $client = $this->getMockedTrait(); + $this->assertEquals([ + "from", + "to", + "subject", + "date", + "seen", + "answered", + "draft", + "flagged", + "recent", + "charset", + "references", + "messageId", + "plain", + "size", + "hasAttachments" + ], $client->getDefaultAttributes()); + } + + + /** + * getAttr() + * @throws ReflectionException + */ + public function testGetAttr() + { + $client = $this->getMockedTrait(); + + $reflection = new ReflectionClass($client); + $property = $reflection->getMethod("getAttr"); + $property->setAccessible(true); + + $this->assertEquals( + true, + $property->invokeArgs($client, ["foo", ["foo" => true]]) + ); + + $this->assertEquals( + true, + $property->invokeArgs($client, ["foo", ["foo" => []], "snafu"]) + ); + + $this->assertEquals( + null, + $property->invokeArgs($client, ["foo", ["bar" => true]]) + ); + + $this->assertEquals( + null, + $property->invokeArgs($client, ["foo", ["foo" => false]]) + ); + + $this->assertEquals( + "default", + $property->invokeArgs($client, ["foo", ["foo" => false], "default"]) + ); + } + + + + /** + * @return __anonymous@1559 + */ + public function getMockedTrait() + { + return new class (){ + use AttributeTrait; + }; + } +} diff --git a/tests/Horde_Imap/Client/ClientGeneratorTrait.php b/tests/Horde/Mail/Client/Imap/ClientGeneratorTrait.php similarity index 75% rename from tests/Horde_Imap/Client/ClientGeneratorTrait.php rename to tests/Horde/Mail/Client/Imap/ClientGeneratorTrait.php index 2012549f..c950a164 100644 --- a/tests/Horde_Imap/Client/ClientGeneratorTrait.php +++ b/tests/Horde/Mail/Client/Imap/ClientGeneratorTrait.php @@ -27,20 +27,19 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; -use Conjoon\Horde_Imap\Client\HordeClient; -use Conjoon\Horde_Imap\Client\SortInfoStrategy; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Message\Composer\AttachmentComposer; -use Conjoon\MailClient\Message\Composer\BodyComposer; -use Conjoon\MailClient\Message\Composer\HeaderComposer; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItemDraft; +use Conjoon\Horde\Mail\Client\Imap\HordeClient; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Message\Composer\AttachmentComposer; +use Conjoon\Mail\Client\Message\Composer\BodyComposer; +use Conjoon\Mail\Client\Message\Composer\HeaderComposer; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItemDraft; /** * Trait ClientGeneratorTrait - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ trait ClientGeneratorTrait { @@ -89,17 +88,6 @@ public function compose(string $target, MessageItemDraft $source = null): string } - /** - * @return SortInfoStrategy - */ - protected function createSortInfoStrategy(): SortInfoStrategy - { - - return new class () extends SortInfoStrategy { - }; - } - - /** * Creates an instance of HordeClient. * @@ -107,7 +95,6 @@ protected function createSortInfoStrategy(): SortInfoStrategy * @param null $bodyComposer * @param null $headerComposer * @param null $attachmentComposer - * @param null $sortInfoStrategy * * @return HordeClient */ @@ -115,8 +102,7 @@ protected function createClient( $mailAccount = null, $bodyComposer = null, $headerComposer = null, - $attachmentComposer = null, - $sortInfoStrategy = null + $attachmentComposer = null ): HordeClient { if (!$mailAccount) { @@ -135,16 +121,6 @@ protected function createClient( $attachmentComposer = $this->createAttachmentComposer(); } - if (!$sortInfoStrategy) { - $sortInfoStrategy = $this->createSortInfoStrategy(); - } - - return new HordeClient( - $mailAccount, - $bodyComposer, - $headerComposer, - $attachmentComposer, - $sortInfoStrategy - ); + return new HordeClient($mailAccount, $bodyComposer, $headerComposer, $attachmentComposer); } } diff --git a/tests/Horde_Imap/Client/FilterTraitTest.php b/tests/Horde/Mail/Client/Imap/FilterTraitTest.php similarity index 54% rename from tests/Horde_Imap/Client/FilterTraitTest.php rename to tests/Horde/Mail/Client/Imap/FilterTraitTest.php index 408f41df..4c70ae8e 100644 --- a/tests/Horde_Imap/Client/FilterTraitTest.php +++ b/tests/Horde/Mail/Client/Imap/FilterTraitTest.php @@ -27,20 +27,14 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; -use Conjoon\Data\Filter\Filter; -use Conjoon\Horde_Imap\Client\FilterTrait; -use Conjoon\Math\Expression\FunctionalExpression; -use Conjoon\Math\Expression\LogicalExpression; -use Conjoon\Math\Expression\RelationalExpression; -use Conjoon\Math\Value; -use Conjoon\Math\VariableName; +use Conjoon\Horde\Mail\Client\Imap\FilterTrait; use Tests\TestCase; /** * Class FilterTraitTest - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ class FilterTraitTest extends TestCase { @@ -53,49 +47,29 @@ public function testGetSearchQueryFromFilter() $tests = [ [ - "input" => new Filter( - LogicalExpression::OR( - RelationalExpression::EQ( - VariableName::make("RECENT"), - Value::make(true) - ), - RelationalExpression::GE( - VariableName::make("ID"), - Value::make(1000) - ) - ) - ), + "input" => [], + "output" => "ALL" + ], [ + "input" => [ + ["property" => "recent", "value" => true, "operator" => "="], + ["property" => "id", "value" => 1000, "operator" => ">="] + ], "output" => "OR (UID 1000:*) (RECENT)" ], [ - "input" => new Filter( - RelationalExpression::EQ( - VariableName::make("RECENT"), - Value::make(true) - ) - ), + "input" => [ + ["property" => "recent", "value" => true, "operator" => "="] + ], "output" => "RECENT" ], [ - "input" => new Filter( - RelationalExpression::GE( - VariableName::make("UID"), - Value::make(1000) - ) - ), + "input" => [ + ["property" => "id", "value" => 1000, "operator" => ">="] + ], "output" => "UID 1000:*" ], [ - "input" => new Filter( - LogicalExpression::OR( - RelationalExpression::EQ( - VariableName::make("RECENT"), - Value::make(true) - ), - FunctionalExpression::IN( - VariableName::make("UID"), - Value::make(1000), - Value::make(1001) - ) - ) - ), + "input" => [ + ["property" => "recent", "value" => true, "operator" => "="], + ["property" => "id", "value" => [1000, 1001], "operator" => "IN"] + ], "output" => "OR (UID 1000:1001) (RECENT)" ] ]; diff --git a/tests/Horde_Imap/Client/HordeClientTest.php b/tests/Horde/Mail/Client/Imap/HordeClientTest.php similarity index 68% rename from tests/Horde_Imap/Client/HordeClientTest.php rename to tests/Horde/Mail/Client/Imap/HordeClientTest.php index c2b9218f..c4d2a9db 100644 --- a/tests/Horde_Imap/Client/HordeClientTest.php +++ b/tests/Horde/Mail/Client/Imap/HordeClientTest.php @@ -27,48 +27,33 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; - -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\Mime\MimeType; -use Conjoon\Data\ParameterBag; -use Conjoon\Data\Sort\SortDirection; -use Conjoon\Data\Sort\SortInfo; -use Conjoon\Data\Sort\SortInfoList; -use Conjoon\Data\Filter\Filter; -use Conjoon\Horde_Imap\Client\HordeClient; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; -use Conjoon\MailClient\Exception\MailFolderNotFoundException; -use Conjoon\MailClient\Folder\MailFolderList; -use Conjoon\MailClient\Data\Protocol\Imap\ImapClientException; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Message\Composer\HeaderComposer; -use Conjoon\MailClient\Message\Flag\FlaggedFlag; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\Flag\SeenFlag; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; -use Conjoon\MailClient\Data\Resource\Query\MessageItemListQuery; -use Conjoon\MailClient\Data\Resource\MessageItem as MessageItemResource; -use Conjoon\Math\Expression\FunctionalExpression; -use Conjoon\Math\Value; -use Conjoon\Math\VariableName; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; + +use Conjoon\Core\ParameterBag; +use Conjoon\Horde\Mail\Client\Imap\HordeClient; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\Folder\MailFolderList; +use Conjoon\Mail\Client\Imap\ImapClientException; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\Message\Flag\FlaggedFlag; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\Flag\SeenFlag; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; use DateTime; use Exception; use Horde_Imap_Client; use Horde_Imap_Client_Data_Fetch; -use Horde_Imap_Client_Exception; use Horde_Imap_Client_Fetch_Results; use Horde_Imap_Client_Ids; use Horde_Imap_Client_Search_Query; @@ -83,29 +68,21 @@ use ReflectionClass; use ReflectionException; use RuntimeException; -use stdClass; use Tests\TestCase; use Tests\TestTrait; -use Conjoon\Horde_Imap\Client\FilterTrait; -use Conjoon\Horde_Imap\Client\AttachmentTrait; +use Conjoon\Horde\Mail\Client\Imap\FilterTrait; +use Conjoon\Horde\Mail\Client\Imap\AttributeTrait; +use Conjoon\Horde\Mail\Client\Imap\AttachmentTrait; /** * Class HordeClientTest - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ class HordeClientTest extends TestCase { use TestTrait; use ClientGeneratorTrait; - public function setUp(): void - { - parent::setUp(); // TODO: Change the autogenerated stub - - $this->jsonStrategy = new JsonTestStrategy(); - } - - /** * Tests constructor and base class. */ @@ -113,13 +90,11 @@ public function testClass() { $uses = class_uses(HordeClient::class); $this->assertContains(FilterTrait::class, $uses); + $this->assertContains(AttributeTrait::class, $uses); $this->assertContains(AttachmentTrait::class, $uses); - $sortInfoStrategy = $this->createSortInfoStrategy(); - $client = $this->createClient(sortInfoStrategy: $sortInfoStrategy); + $client = $this->createClient(); $this->assertInstanceOf(MailClient::class, $client); - - $this->assertSame($sortInfoStrategy, $client->getSortInfoStrategy()); } @@ -150,7 +125,7 @@ public function testGetMailAccount() $this->assertSame( null, - $client->getMailAccount("89") + $client->getMailAccount(89) ); } @@ -194,55 +169,27 @@ public function testConnect() /** - * tests getMessageItemList with Horde_Imap_Client_Exception + * @runInSeparateProcess + * @preserveGlobalState disabled */ public function testGetMessageItemListException() { - $folderKey = $this->createFolderKey( - $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org")->getId(), - "INBOX" - ); $this->expectException(ImapClientException::class); - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods(["connect"]) - ->getMock(); - - $client->expects($this->once()) - ->method("connect") - ->with($folderKey) - ->willThrowException(new Horde_Imap_Client_Exception()); - - $client->getMessageItemList($folderKey, $this->createMessageItemListQuery()); - } + $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); + $imapStub->shouldReceive("query") + ->andThrow(new Exception("This exception should be caught properly by the test")); - /** - * tests getMessageItemList with MailFolderNotFoundException - */ - public function testGetMessageItemListMailFolderNotFoundException() - { - $folderKey = $this->createFolderKey( - $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org")->getId(), - "INBOX" + $client = $this->createClient(); + $client->getMessageItemList( + $this->createFolderKey( + $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org")->getId(), + "INBOX" + ), + new MessageItemListResourceQuery(new ParameterBag(["start" => 0, "limit" => 25])) ); - - $this->expectException(MailFolderNotFoundException::class); - - $socket = $this->getMockBuilder(Horde_Imap_Client_Socket::class) - ->disableOriginalConstructor() - ->getMock(); - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods(["connect", "doesMailboxExist"]) - ->getMock(); - - $client->expects($this->once())->method("connect")->with($folderKey)->willReturn($socket); - $client->expects($this->once())->method("doesMailboxExist")->with($folderKey)->willReturn(false); - - $client->getMessageItemList($folderKey, $this->createMessageItemListQuery()); } @@ -256,19 +203,11 @@ public function testGetMessageItemList() { $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); - $folderKey = $this->createFolderKey( - $account->getId(), - "INBOX" - ); $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); - $imapStub->shouldReceive("listMailboxes") - ->with($folderKey->getId(), Horde_Imap_Client::MBOX_ALL) - ->andReturn([$folderKey->getId() => ""]); - - $imapStub->shouldReceive("search")->with($folderKey->getId(), Mockery::any(), [ - "sort" => [Horde_Imap_Client::SORT_REVERSE, Horde_Imap_Client::SORT_SIZE] + $imapStub->shouldReceive("search")->with("INBOX", Mockery::any(), [ + "sort" => [Horde_Imap_Client::SORT_REVERSE, Horde_Imap_Client::SORT_DATE] ])->andReturn(["match" => new Horde_Imap_Client_Ids([111, 222, 333])]); $messageIds = [111 => "foo", 222 => "bar"]; @@ -291,7 +230,7 @@ public function testGetMessageItemList() $fetchResults[222]->setHeaders("References", "References: " . $references[222]); $imapStub->shouldReceive("fetch")->with( - $folderKey->getId(), + "INBOX", Mockery::any(), Mockery::type("array") )->andReturn( @@ -300,32 +239,21 @@ public function testGetMessageItemList() $client = $this->createClient(); - - $messageItemListQuery = $this->createMockForAbstract( - MessageItemListQuery::class, - ["getFields", "getStart", "getLimit", "getSort", "getFilter"], - [new ParameterBag()] - ); - $messageItemListQuery->expects($this->atLeastOnce())->method("getFields")->willReturn( - (new MessageItemResource())->getDefaultFields() + $messageItemList = $client->getMessageItemList( + $this->createFolderKey( + $account->getId(), + "INBOX" + ), + new MessageItemListResourceQuery(new ParameterBag(["start" => 0, "limit" => 2])) ); - $messageItemListQuery->expects($this->once())->method("getStart")->willReturn(0); - $messageItemListQuery->expects($this->once())->method("getLimit")->willReturn(2); - $sortInfoList = new SortInfoList(); - $sortInfoList[] = new SortInfo("size", SortDirection::DESC); - $messageItemListQuery->expects($this->once())->method("getSort")->willReturn($sortInfoList); - $messageItemListQuery->expects($this->once())->method("getFilter")->willReturn(null); - - - $messageItemList = $client->getMessageItemList($folderKey, $messageItemListQuery); $this->assertInstanceOf(MessageItemList::class, $messageItemList); $this->assertSame(2, count($messageItemList)); - $this->assertInstanceOf(MessageItem::Class, $messageItemList[0]); - $this->assertInstanceOf(MessageItem::Class, $messageItemList[1]); + $this->assertInstanceOf(ListMessageItem::Class, $messageItemList[0]); + $this->assertInstanceOf(ListMessageItem::Class, $messageItemList[1]); $this->assertSame("utf-8", $messageItemList[0]->getCharset()); $this->assertSame("iso-8859-1", $messageItemList[1]->getCharset()); @@ -334,15 +262,15 @@ public function testGetMessageItemList() $this->assertSame("INBOX", $messageItemList[0]->getMessageKey()->getMailFolderId()); $this->assertEquals( ["name" => "dev@conjoon.org", "address" => "dev@conjoon.org"], - $messageItemList[0]->getFrom()->toJson($this->jsonStrategy) + $messageItemList[0]->getFrom()->toJson() ); $this->assertEquals( [["name" => "devrec@conjoon.org", "address" => "devrec@conjoon.org"]], - $messageItemList[0]->getTo()->toJson($this->jsonStrategy) + $messageItemList[0]->getTo()->toJson() ); $this->assertEquals( [], - $messageItemList[1]->getTo()->toJson($this->jsonStrategy) + $messageItemList[1]->getTo()->toJson() ); $this->assertSame($messageIds[111], $messageItemList[0]->getMessageId()); @@ -354,24 +282,17 @@ public function testGetMessageItemList() /** - * Multiple Message Item Test with fields specified + * Multiple Message Item Test with attributes specified * * @runInSeparateProcess * @preserveGlobalState disabled */ - public function testGetMessageItemListWithSpecifiedFields() + public function testGetMessageItemListWithSpecifiedAttributes() { $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); - $folderKey = $this->createFolderKey( - $account->getId(), - "INBOX" - ); $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); - $imapStub->shouldReceive("listMailboxes") - ->with($folderKey->getId(), Horde_Imap_Client::MBOX_ALL) - ->andReturn([$folderKey->getId() => ""]); $imapStub->shouldReceive("search")->with("INBOX", Mockery::any(), [ "sort" => [Horde_Imap_Client::SORT_REVERSE, Horde_Imap_Client::SORT_DATE] @@ -392,7 +313,7 @@ public function testGetMessageItemListWithSpecifiedFields() $fetchResults[111]->setHeaders("References", "References: " . $references[111]); $imapStub->shouldReceive("fetch")->with( - $folderKey->getId(), + "INBOX", Mockery::any(), Mockery::type("array") )->andReturn( @@ -401,23 +322,14 @@ public function testGetMessageItemListWithSpecifiedFields() $client = $this->createClient(); - - $messageItemListQuery = $this->createMockForAbstract( - MessageItemListQuery::class, - ["getFields", "getStart", "getLimit"], - [new ParameterBag()] - ); - $messageItemListQuery->expects($this->atLeastOnce())->method("getFields")->willReturn( - ["from", "references"] - ); - $messageItemListQuery->expects($this->once())->method("getStart")->willReturn(0); - $messageItemListQuery->expects($this->once())->method("getLimit")->willReturn(1); - $messageItemListQuery->expects($this->once())->method("getSort")->willReturn(null); - $messageItemListQuery->expects($this->once())->method("getFilter")->willReturn(null); - $messageItemList = $client->getMessageItemList( - $folderKey, - $messageItemListQuery + $this->createFolderKey( + $account->getId(), + "INBOX" + ), + new MessageItemListResourceQuery(new ParameterBag( + ["start" => 0, "limit" => 1, "attributes" => ["from" => true, "references" => true]] + )) ); $this->assertEquals([ @@ -426,7 +338,7 @@ public function testGetMessageItemListWithSpecifiedFields() "mailAccountId" => $messageItemList[0]->getMessageKey()->getMailAccountId(), "references" => $references[111], "from" => ["name" => "dev@conjoon.org", "address" => "dev@conjoon.org"] - ], $messageItemList[0]->toJson($this->jsonStrategy)); + ], $messageItemList[0]->toJson()); } @@ -438,19 +350,13 @@ public function testGetMessageItemListWithSpecifiedFields() */ public function testGetMessageItemListWidthIdSpecified() { + $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); - $folderKey = $this->createFolderKey( - $account->getId(), - "INBOX" - ); $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); - $imapStub->shouldReceive("listMailboxes") - ->with($folderKey->getId(), Horde_Imap_Client::MBOX_ALL) - ->andReturn([$folderKey->getId() => ""]); $imapStub->shouldReceive("search")->with( - $folderKey->getId(), + "INBOX", Mockery::on(function ($searchQuery) { return $searchQuery instanceof Horde_Imap_Client_Search_Query && $searchQuery->__toString() === "UID 34"; @@ -469,7 +375,7 @@ public function testGetMessageItemListWidthIdSpecified() $imapStub->shouldReceive("fetch")->with( - $folderKey->getId(), + "INBOX", Mockery::any(), Mockery::type("array") )->andReturn( @@ -478,29 +384,22 @@ public function testGetMessageItemListWidthIdSpecified() $client = $this->createClient(); - $messageItemListQuery = $this->createMockForAbstract( - MessageItemListQuery::class, - ["getFilter"], - [new ParameterBag()] - ); - $filter = new Filter(FunctionalExpression::IN(VariableName::make("UID"), Value::make(34))); - $messageItemListQuery->expects($this->atLeastOnce())->method("getFields")->willReturn( - (new MessageItemResource())->getDefaultFields() - ); - $messageItemListQuery->expects($this->atLeastOnce())->method("getFilter")->willReturn($filter); - $messageItemListQuery->expects($this->once())->method("getStart")->willReturn(0); - $messageItemListQuery->expects($this->once())->method("getLimit")->willReturn(1); - $messageItemList = $client->getMessageItemList( - $folderKey, - $messageItemListQuery + $this->createFolderKey( + $account->getId(), + "INBOX" + ), + new MessageItemListResourceQuery(new ParameterBag( + ["filter" => [["property" => "id", "operator" => "in", "value" => [34]]]] + )) ); + $this->assertInstanceOf(MessageItemList::class, $messageItemList); $this->assertSame(1, count($messageItemList)); - $this->assertInstanceOf(MessageItem::Class, $messageItemList[0]); + $this->assertInstanceOf(ListMessageItem::Class, $messageItemList[0]); $this->assertSame("utf-8", $messageItemList[0]->getCharset()); @@ -508,11 +407,11 @@ public function testGetMessageItemListWidthIdSpecified() $this->assertSame("INBOX", $messageItemList[0]->getMessageKey()->getMailFolderId()); $this->assertEquals( ["name" => "dev@conjoon.org", "address" => "dev@conjoon.org"], - $messageItemList[0]->getFrom()->toJson($this->jsonStrategy) + $messageItemList[0]->getFrom()->toJson() ); $this->assertEquals( [["name" => "devrec@conjoon.org", "address" => "devrec@conjoon.org"]], - $messageItemList[0]->getTo()->toJson($this->jsonStrategy) + $messageItemList[0]->getTo()->toJson() ); $this->assertSame("", $messageItemList[0]->getReferences()); @@ -526,6 +425,8 @@ public function testGetMessageItemListWidthIdSpecified() */ public function testGetMessageItem() { + + $client = $this->createClient(); $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); @@ -551,18 +452,7 @@ public function testGetMessageItem() )->andReturn($fetchResults); - $messageItemQuery = $this->createMockForAbstract( - MessageItemQuery::class, - ["getFields"], - [new ParameterBag()] - ); - $messageItemQuery->expects($this->once())->method("getFields")->willReturn( - (new MessageItemResource())->getDefaultFields() - ); - $item = $client->getMessageItem( - $this->createMessageKey($account->getId(), "INBOX", "16"), - $messageItemQuery - ); + $item = $client->getMessageItem($this->createMessageKey($account->getId(), "INBOX", "16")); $this->assertInstanceOf(MessageItem::class, $item); $this->assertSame(null, $item->getFrom()); @@ -600,8 +490,6 @@ public function testGetMessageItemDraft() $messageId = "kjgjkggjkkgjkgj"; - $draftInfo = "draftInfo"; - $fetchResults[16]->setEnvelope([ "cc" => $cc[0]->getAddress(), "bcc" => $bcc[0]->getAddress(), @@ -609,33 +497,19 @@ public function testGetMessageItemDraft() "message-id" => $messageId ]); - $fetchResults[16]->setHeaders("X-CN-DRAFT-INFO", $draftInfo); - $imapStub->shouldReceive("fetch")->with( "INBOX", Mockery::any(), Mockery::type("array") )->andReturn($fetchResults); - $messageItemQuery = $this->createMockForAbstract( - MessageItemQuery::class, - ["getFields"], - [new ParameterBag()] - ); - $messageItemQuery->expects($this->once())->method("getFields")->willReturn( - (new MessageItemResource())->getFields() - ); - $item = $client->getMessageItemDraft( - $this->createMessageKey($account->getId(), "INBOX", "16"), - $messageItemQuery - ); + $item = $client->getMessageItemDraft($this->createMessageKey($account->getId(), "INBOX", "16")); $this->assertInstanceOf(MessageItemDraft::class, $item); $this->assertEquals($cc, $item->getCc()); $this->assertEquals($bcc, $item->getBcc()); $this->assertEquals($replyTo, $item->getReplyTo()); $this->assertSame($messageId, $item->getMessageId()); - $this->assertSame($draftInfo, $item->getDraftInfo()); } @@ -671,6 +545,28 @@ public function testGetMessageBody() } + /** + * Tests getTotalMessageCount + * + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testGetTotalMessageCount() + { + $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); + + $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); + + $imapStub->shouldReceive("search")->with("INBOX", Mockery::any(), []) + ->andReturn(["match" => new Horde_Imap_Client_Ids([111, 222, 333])]); + + $client = $this->createClient(); + + $count = $client->getTotalMessageCount($this->createFolderKey($account->getId(), "INBOX")); + $this->assertSame(3, $count); + } + + /** * Tests getTotalUnreadCount * @@ -683,26 +579,25 @@ public function testGetTotalUnreadCount() $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); - $imapStub->shouldReceive("status") - ->with( - "INBOX", - Horde_Imap_Client::STATUS_UNSEEN, - Horde_Imap_Client::STATUS_MESSAGES - ) - ->andReturn(["unseen" => 2, "messages" => 100]); + $imapStub->shouldReceive("status")->with("INBOX", Horde_Imap_Client::STATUS_UNSEEN) + ->andReturn(["unseen" => 2]); $client = $this->createClient(); - $numbers = $client->getMessageCount($this->createFolderKey($account->getId(), "INBOX")); - $this->assertEquals(["unreadMessages" => 2, "totalMessages" => 100], $numbers); + $unreadCount = $client->getUnreadMessageCount($this->createFolderKey($account->getId(), "INBOX")); + $this->assertSame(2, $unreadCount); } /** - * Tests getMailFolderList testtemplate + * Tests getMailFolderList + * + * @runInSeparateProcess + * @preserveGlobalState disabled */ - public function getMailFolderListTemplate(MailFolderListQuery $query) + public function testGetMailFolderList() { + $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); $imapStub = Mockery::mock("overload:" . Horde_Imap_Client_Socket::class); @@ -716,168 +611,37 @@ public function getMailFolderListTemplate(MailFolderListQuery $query) "INBOX.Folder" => ["delimiter" => ":", "attributes" => ["\\noselect"]] ]); - $inline = [[] , []]; - $args = ["INBOX"]; - $return = []; - - - $getUnreadMessages = in_array("unreadMessages", $query->getFields()); - $getTotalMessages = in_array("totalMessages", $query->getFields()); - $getName = in_array("name", $query->getFields()); - - if ($getUnreadMessages) { - $args[] = Horde_Imap_Client::STATUS_UNSEEN; - $return["unseen"] = 30; - $inline[0][] = fn($listMailFolder) - => $this->assertSame(30, $listMailFolder->getUnreadMessages()); - } - if ($getTotalMessages) { - $args[] = Horde_Imap_Client::STATUS_MESSAGES; - $return["messages"] = 100; - $inline[0][] = fn($listMailFolder) - => $this->assertSame(100, $listMailFolder->getTotalMessages()); - } - if ($getName) { - $inline[0][] = fn($listMailFolder) - => $this->assertSame("INBOX", $listMailFolder->getName()); - - $inline[1][] = fn($listMailFolder) => - $this->assertSame("INBOX.Folder", $listMailFolder->getName()); - } - - $imapStub->shouldReceive("status")->with( - ...$args - )->andReturn($return); + "INBOX", + Horde_Imap_Client::STATUS_UNSEEN + )->andReturn(["unseen" => 30]); $imapStub->shouldNotReceive("status")->with( "INBOX.Folder", - Horde_Imap_Client::STATUS_UNSEEN, - Horde_Imap_Client::STATUS_MESSAGES + Horde_Imap_Client::STATUS_UNSEEN ); $client = $this->createClient(); - $mailFolderList = $client->getMailFolderList( - $account, - $query - ); + $mailFolderList = $client->getMailFolderList($account); $this->assertInstanceOf(MailFolderList::class, $mailFolderList); $listMailFolder = $mailFolderList[0]; + $this->assertSame("INBOX", $listMailFolder->getName()); $this->assertSame(".", $listMailFolder->getDelimiter()); - - foreach ($inline[0] as $func) { - $func($listMailFolder); - } - + $this->assertSame(30, $listMailFolder->getUnreadCount()); $this->assertSame([], $listMailFolder->getAttributes()); $listMailFolder = $mailFolderList[1]; - foreach ($inline[1] as $func) { - $func($listMailFolder); - } + $this->assertSame("INBOX.Folder", $listMailFolder->getName()); $this->assertSame(":", $listMailFolder->getDelimiter()); - $this->assertSame(null, $listMailFolder->getUnreadMessages()); - $this->assertSame(null, $listMailFolder->getTotalMessages()); + $this->assertSame(0, $listMailFolder->getUnreadCount()); $this->assertSame(["\\noselect"], $listMailFolder->getAttributes()); } - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList1() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn(["unreadMessages"]); - - $this->getMailFolderListTemplate($query); - } - - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList2() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn(["unreadMessages", "totalMessages"]); - - $this->getMailFolderListTemplate($query); - } - - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList3() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn(["unreadMessages", "totalMessages", "name"]); - - $this->getMailFolderListTemplate($query); - } - - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList4() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn(["name"]); - - $this->getMailFolderListTemplate($query); - } - - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList5() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn(["name", "unreadMessages"]); - - $this->getMailFolderListTemplate($query); - } - - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList6() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn(["name", "totalmessages"]); - - $this->getMailFolderListTemplate($query); - } - - - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ - public function testGetMailFolderList7() - { - $query = $this->createMockForAbstract(MailFolderListQuery::class, ["getFields"], [new ParameterBag()]); - $query->expects($this->any())->method("getFields")->willReturn([]); - - $this->getMailFolderListTemplate($query); - } - - - /** * Tests setFlags * @@ -952,8 +716,8 @@ public function testCreateMessageBodyDraft() $messageItemId = "989786"; $messageBodyDraft = new MessageBodyDraft(); - $htmlPart = new MessagePart("foo", "UTF-8", MimeType::TEXT_HTML); - $plainPart = new MessagePart("bar", "UTF-8", MimeType::TEXT_PLAIN); + $htmlPart = new MessagePart("foo", "UTF-8", "text/html"); + $plainPart = new MessagePart("bar", "UTF-8", "text/plain"); $messageBodyDraft->setTextHtml($htmlPart); $messageBodyDraft->setTextPlain($plainPart); @@ -989,7 +753,7 @@ public function testCreateMessageBodyDraft() * @runInSeparateProcess * @preserveGlobalState disabled */ - public function testUpdateMessageBodyDraftHasNoMessageKey() + public function testCreateMessageBodyDraftHasNoMessageKey() { $this->expectException(ImapClientException::class); @@ -999,110 +763,6 @@ public function testUpdateMessageBodyDraftHasNoMessageKey() } - /** - * Tests createMessageDraft with a MessageItemDraft that already has a MessageKey - * - */ - public function testCreateMessageDraftHasMessageKey() - { - $folderKey = $this->createFolderKey( - $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org")->getId(), - "INBOX" - ); - - $this->expectException(ImapClientException::class); - - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods([]) - ->getMock(); - - $messageItemDraft = new MessageItemDraft( - new MessageKey("a", "b", "c") - ); - - $client->createMessageDraft($folderKey, $messageItemDraft); - } - - - /** - * Tests createMessageDraft with a folderKey representing a non existing folder. - */ - public function testCreateMessageDraftFolderMissing() - { - $folderKey = $this->createFolderKey( - $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org")->getId(), - "INBOX" - ); - - $this->expectException(MailFolderNotFoundException::class); - - $socket = $this->getMockBuilder(Horde_Imap_Client_Socket::class) - ->disableOriginalConstructor() - ->getMock(); - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods(["connect", "doesMailboxExist"]) - ->getMock(); - - $client->expects($this->once())->method("connect")->with($folderKey)->willReturn($socket); - $client->expects($this->once())->method("doesMailboxExist")->with($folderKey)->willReturn(false); - - $client->createMessageDraft($folderKey, new MessageItemDraft()); - } - - /** - * Tests createMessageDraft - */ - public function testCreateMessageDraft() - { - - $messageItemDraft = new MessageItemDraft(); - - $folderKey = $this->createFolderKey( - $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org")->getId(), - "INBOX" - ); - - $composer = $this->getMockForAbstractClass(HeaderComposer::class); - - $socket = $this->getMockBuilder(Horde_Imap_Client_Socket::class) - ->disableOriginalConstructor() - ->onlyMethods(["append"]) - ->getMock(); - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods(["connect", "doesMailboxExist","getHeaderComposer"]) - ->getMock(); - - $client->expects($this->once())->method("connect")->with($folderKey)->willReturn($socket); - $client->expects($this->once())->method("doesMailboxExist")->with($folderKey)->willReturn(true); - - $composer->expects($this->once())->method("compose")->with("", $messageItemDraft)->willReturn("HEADER"); - $client->expects($this->once())->method("getHeaderComposer")->willReturn($composer); - - $ids = new stdClass(); - $ids->ids = [1]; - $socket->expects($this->once())->method("append")->with( - $folderKey->getId(), - [[ - "data" => "HEADER", - "flags" => $messageItemDraft->getFlagList()->resolveToFlags() - ]] - )->willReturn($ids); - - - $createdDraft = $client->createMessageDraft($folderKey, $messageItemDraft); - - $this->assertNotSame($createdDraft, $messageItemDraft); - - $this->assertEquals([ - "mailAccountId" => $folderKey->getMailAccountId(), - "mailFolderId" => $folderKey->getId(), - "id" => (string)$ids->ids[0] - ], $createdDraft->getMessageKey()->toArray()); - } - /** * Tests updateMessageBodyDraft * @@ -1119,8 +779,8 @@ public function testUpdateMessageBodyDraft() $messageKey = new MessageKey($account, $mailFolderId, $messageItemId); $messageBodyDraft = new MessageBodyDraft($messageKey); - $htmlPart = new MessagePart("foo", "UTF-8", MimeType::TEXT_HTML); - $plainPart = new MessagePart("bar", "UTF-8", MimeType::TEXT_PLAIN); + $htmlPart = new MessagePart("foo", "UTF-8", "text/html"); + $plainPart = new MessagePart("bar", "UTF-8", "text/plain"); $messageBodyDraft->setTextHtml($htmlPart); $messageBodyDraft->setTextPlain($plainPart); @@ -1269,8 +929,8 @@ public function getFullMsg(): string $res = $client->updateMessageDraft($messageItemDraft); - $aJson = $messageItemDraft->toJson($this->jsonStrategy); - $bJson = $res->toJson($this->jsonStrategy); + $aJson = $messageItemDraft->toJson(); + $bJson = $res->toJson(); unset($aJson["id"]); unset($bJson["id"]); @@ -1318,7 +978,6 @@ public function testGetMailer() /** * Tests getMailer() with secure param - * @throws ReflectionException */ public function testGetMailerSecure() { @@ -1330,6 +989,7 @@ public function testGetMailerSecure() "outbox_password" => "outboxPassword", "outbox_secure" => "ssl" ]); + ; $client = $this->createClient($mailAccount); $mailer = $client->getMailer($mailAccount); @@ -1405,7 +1065,7 @@ public function __construct() * * @noinspection PhpUnused */ - public function getFullMsg(): void + public function getFullMsg() { } @@ -1641,15 +1301,12 @@ public function testGetTextContentReturnsDefaultNoMessageData() */ public function testQueryItems() { + $options = ["filter" => [[]]]; + $key = new FolderKey("dev", "INBOX"); $search = new Horde_Imap_Client_Search_Query(); - $sortInfo = null; - $filter = new Filter( - FunctionalExpression::IN(VariableName::make("size"), Value::make(1)) - ); - $socket = $this->getMockBuilder(Horde_Imap_Client_Socket::class) ->disableOriginalConstructor() ->onlyMethods(["search"]) @@ -1664,23 +1321,22 @@ public function testQueryItems() ->with( $key->getId(), $search, - ["sort" => [Horde_Imap_Client::SORT_REVERSE, Horde_Imap_Client::SORT_DATE]] + $this->anything() ) ->willReturn([]); $client->expects($this->once()) ->method("getSearchQueryFromFilter") - ->with($filter) + ->with($options["filter"]) ->willReturn($search); $reflection = new ReflectionClass(HordeClient::class); $queryItems = $reflection->getMethod("queryItems"); $queryItems->setAccessible(true); - $queryItems->invokeArgs($client, [$socket, $key, $sortInfo, $filter]); + $queryItems->invokeArgs($client, [$socket, $key, $options]); } - // ------------------------------- // Helper // ------------------------------- @@ -1691,7 +1347,7 @@ public function testQueryItems() * * @param mixed $testType true, false or "exception" */ - protected function deleteMessageTest(mixed $testType) + protected function deleteMessageTest($testType) { $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); @@ -1720,11 +1376,9 @@ protected function deleteMessageTest(mixed $testType) $client = $this->createClient(); - $res = null; - try { $res = $client->deleteMessage($messageKey); - } catch (ImapClientException) { + } catch (ImapClientException $exc) { if ($testType === "exception") { $this->assertTrue(true); return; @@ -1733,7 +1387,7 @@ protected function deleteMessageTest(mixed $testType) if ($testType === "exception") { // if we are here, no exception was thrown - $this->fail(); + $this->assertTrue(false); } $resultValue = $testType === true; @@ -1850,12 +1504,21 @@ public function getFlags(): array ->with($basePart); - $value = match ($testType) { - "DRAFTINFO_INVALID" => "NO!", - "DRAFTINFO_NOJSON" => base64_encode("{\"abc\" \"def\"}"), - "INVALID_MAILACCOUNT" => base64_encode(json_encode(["abc", "foo", "bar"])), - default => base64_encode(json_encode([$account->getId(), "foo", "bar"])), - }; + switch ($testType) { + case "DRAFTINFO_INVALID": + $value = "NO!"; + break; + + case "DRAFTINFO_NOJSON": + $value = base64_encode("{\"abc\" \"def\"}"); + break; + case "INVALID_MAILACCOUNT": + $value = base64_encode(json_encode(["abc", "foo", "bar"])); + break; + default: + $value = base64_encode(json_encode([$account->getId(), "foo", "bar"])); + break; + } $headerElement->shouldReceive("__get") @@ -1972,61 +1635,4 @@ protected function createMessageKey($mid, $fid, $id): MessageKey { return new MessageKey($mid, $fid, $id); } - - - /** - * @param ParameterBag|null $bag - * @return MessageItemListQuery - */ - protected function createMessageItemListQuery(?ParameterBag $bag = null): MessageItemListQuery - { - if (!$bag) { - $bag = new ParameterBag(); - } - - return $this->createMockForAbstract(MessageItemListQuery::class, [], [$bag]); - } - - - /** - * @param ParameterBag|null $bag - * @return MessageItemQuery - */ - protected function createMessageItemQuery(?ParameterBag $bag = null): MessageItemQuery - { - if (!$bag) { - $bag = new ParameterBag(); - } - - return $this->createMockForAbstract(MessageItemQuery::class, [], [$bag]); - } - - - /** - * @param ParameterBag|null $bag - * @return MailFolderListQuery - */ - protected function createMailFolderListQuery(?ParameterBag $bag = null): MailFolderListQuery - { - if (!$bag) { - $bag = new ParameterBag(); - } - - return $this->createMockForAbstract(MailFolderListQuery::class, [], [$bag]); - } -} - - -/** - * - */ -class JsonTestStrategy implements JsonStrategy -{ - public function toJson(Arrayable $source): array - { - $data = $source->toArray(); - unset($data["type"]); - - return $data; - } } diff --git a/tests/Horde_Imap/Client/SocketForTesting.php b/tests/Horde/Mail/Client/Imap/SocketForTesting.php similarity index 93% rename from tests/Horde_Imap/Client/SocketForTesting.php rename to tests/Horde/Mail/Client/Imap/SocketForTesting.php index 56e2fde9..7bbafdc8 100644 --- a/tests/Horde_Imap/Client/SocketForTesting.php +++ b/tests/Horde/Mail/Client/Imap/SocketForTesting.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; +namespace Tests\Conjoon\Horde\Mail\Client\Imap; /** * Class SocketForTesting - * @package Tests\Conjoon\Horde_Imap\Client + * @package Tests\Conjoon\Horde\Mail\Client\Imap */ class SocketForTesting { diff --git a/tests/Horde_Mime/Composer/HordeAttachmentComposerTest.php b/tests/Horde/Mail/Client/Message/Composer/HordeAttachmentComposerTest.php similarity index 91% rename from tests/Horde_Mime/Composer/HordeAttachmentComposerTest.php rename to tests/Horde/Mail/Client/Message/Composer/HordeAttachmentComposerTest.php index 9b2fd98b..bd0a001a 100644 --- a/tests/Horde_Mime/Composer/HordeAttachmentComposerTest.php +++ b/tests/Horde/Mail/Client/Message/Composer/HordeAttachmentComposerTest.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Mime\Composer; +namespace Tests\Conjoon\Horde\Mail\Client\Message\Composer; -use Conjoon\Horde_Mime\Composer\HordeAttachmentComposer; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\Message\Composer\AttachmentComposer; +use Conjoon\Horde\Mail\Client\Message\Composer\HordeAttachmentComposer; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Message\Composer\AttachmentComposer; use Horde_Mime_Exception; use Tests\TestCase; diff --git a/tests/Horde_Mime/Composer/HordeBodyComposerTest.php b/tests/Horde/Mail/Client/Message/Composer/HordeBodyComposerTest.php similarity index 89% rename from tests/Horde_Mime/Composer/HordeBodyComposerTest.php rename to tests/Horde/Mail/Client/Message/Composer/HordeBodyComposerTest.php index 2553a444..7463e523 100644 --- a/tests/Horde_Mime/Composer/HordeBodyComposerTest.php +++ b/tests/Horde/Mail/Client/Message/Composer/HordeBodyComposerTest.php @@ -27,13 +27,12 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Mime\Composer; +namespace Tests\Conjoon\Horde\Mail\Client\Message\Composer; -use Conjoon\Mime\MimeType; -use Conjoon\Horde_Mime\Composer\HordeBodyComposer; -use Conjoon\MailClient\Message\Composer\BodyComposer; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessagePart; +use Conjoon\Horde\Mail\Client\Message\Composer\HordeBodyComposer; +use Conjoon\Mail\Client\Message\Composer\BodyComposer; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessagePart; use Tests\TestCase; /** @@ -60,8 +59,8 @@ public function testTransform() { $messageBodyDraft = new MessageBodyDraft(); - $htmlPart = new MessagePart("foo", "UTF-8", MimeType::TEXT_HTML); - $plainPart = new MessagePart("bar", "UTF-8", MimeType::TEXT_PLAIN); + $htmlPart = new MessagePart("foo", "UTF-8", "text/html"); + $plainPart = new MessagePart("bar", "UTF-8", "text/plain"); $messageBodyDraft->setTextHtml($htmlPart); $messageBodyDraft->setTextPlain($plainPart); diff --git a/tests/Horde_Mime/Composer/HordeHeaderComposerTest.php b/tests/Horde/Mail/Client/Message/Composer/HordeHeaderComposerTest.php similarity index 96% rename from tests/Horde_Mime/Composer/HordeHeaderComposerTest.php rename to tests/Horde/Mail/Client/Message/Composer/HordeHeaderComposerTest.php index 7b75e312..5de0850a 100644 --- a/tests/Horde_Mime/Composer/HordeHeaderComposerTest.php +++ b/tests/Horde/Mail/Client/Message/Composer/HordeHeaderComposerTest.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Mime\Composer; - -use Conjoon\Horde_Mime\Composer\HordeHeaderComposer; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Message\Composer\HeaderComposer; -use Conjoon\MailClient\Message\MessageItemDraft; +namespace Tests\Conjoon\Horde\Mail\Client\Message\Composer; + +use Conjoon\Horde\Mail\Client\Message\Composer\HordeHeaderComposer; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\Message\Composer\HeaderComposer; +use Conjoon\Mail\Client\Message\MessageItemDraft; use DateTime; use Horde_Mime_Exception; use Tests\TestCase; @@ -279,7 +279,7 @@ public function testXCnDraftInfo() $composer = new HordeHeaderComposer(); $messageItemDraft = new MessageItemDraft(new MessageKey("a", "b", "c")); - $messageItemDraft->setDraftInfo("somestring"); + $messageItemDraft->setXCnDraftInfo("somestring"); $composed = $composer->compose("", $messageItemDraft); diff --git a/tests/Http/Exception/BadRequestExceptionTest.php b/tests/Http/Exception/BadRequestExceptionTest.php index 6c595976..97f771d9 100644 --- a/tests/Http/Exception/BadRequestExceptionTest.php +++ b/tests/Http/Exception/BadRequestExceptionTest.php @@ -31,7 +31,7 @@ use Conjoon\Http\Exception\BadRequestException; use Conjoon\Http\Exception\HttpException; -use Conjoon\Http\StatusCodes; +use Conjoon\Http\Status\StatusCodes; use Tests\TestCase; /** @@ -43,7 +43,7 @@ class BadRequestExceptionTest extends TestCase /** * test instance */ - public function testInstance(): void + public function testInstance() { $exception = new BadRequestException(); diff --git a/tests/Http/Exception/ForbiddenExceptionTest.php b/tests/Http/Exception/ForbiddenExceptionTest.php deleted file mode 100644 index cef451c3..00000000 --- a/tests/Http/Exception/ForbiddenExceptionTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertInstanceOf(HttpException::class, $exception); - $this->assertSame(StatusCodes::HTTP_403, $exception->getCode()); - } -} diff --git a/tests/Http/Exception/HttpExceptionTest.php b/tests/Http/Exception/HttpExceptionTest.php index 28be6cbd..3cd7dbfa 100644 --- a/tests/Http/Exception/HttpExceptionTest.php +++ b/tests/Http/Exception/HttpExceptionTest.php @@ -42,7 +42,7 @@ class HttpExceptionTest extends TestCase /** * test instance */ - public function testInstance(): void + public function testInstance() { $exception = new HttpException(); diff --git a/tests/Http/Exception/InternalServerErrorExceptionTest.php b/tests/Http/Exception/InternalServerErrorExceptionTest.php index ea6cb6a1..cde2bc2a 100644 --- a/tests/Http/Exception/InternalServerErrorExceptionTest.php +++ b/tests/Http/Exception/InternalServerErrorExceptionTest.php @@ -29,9 +29,9 @@ namespace Tests\Conjoon\Http\Exception; -use Conjoon\Http\Exception\HttpException; use Conjoon\Http\Exception\InternalServerErrorException; -use Conjoon\Http\StatusCodes; +use Conjoon\Http\Exception\HttpException; +use Conjoon\Http\Status\StatusCodes; use Tests\TestCase; /** @@ -43,7 +43,7 @@ class InternalServerErrorExceptionTest extends TestCase /** * test instance */ - public function testInstance(): void + public function testInstance() { $exception = new InternalServerErrorException(); diff --git a/tests/Http/Exception/MethodNotAllowedExceptionTest.php b/tests/Http/Exception/MethodNotAllowedExceptionTest.php deleted file mode 100644 index 3bac5a43..00000000 --- a/tests/Http/Exception/MethodNotAllowedExceptionTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertInstanceOf(HttpException::class, $exception); - $this->assertSame(StatusCodes::HTTP_405, $exception->getCode()); - } -} diff --git a/tests/Http/Exception/NotFoundExceptionTest.php b/tests/Http/Exception/NotFoundExceptionTest.php deleted file mode 100644 index c13901e4..00000000 --- a/tests/Http/Exception/NotFoundExceptionTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertInstanceOf(HttpException::class, $exception); - } -} diff --git a/tests/Http/Exception/UnauthorizedExceptionTest.php b/tests/Http/Exception/UnauthorizedExceptionTest.php deleted file mode 100644 index 72295cef..00000000 --- a/tests/Http/Exception/UnauthorizedExceptionTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertInstanceOf(HttpException::class, $exception); - } -} diff --git a/tests/Http/Json/Problem/AbstractProblemTest.php b/tests/Http/Json/Problem/AbstractProblemTest.php new file mode 100644 index 00000000..51cf3f08 --- /dev/null +++ b/tests/Http/Json/Problem/AbstractProblemTest.php @@ -0,0 +1,89 @@ +getMockForAbstractClass(AbstractProblem::class); + + $this->assertInstanceOf(Jsonable::class, $problem); + + $this->assertNull($problem->getStatus()); + $this->assertSame("", $problem->getTitle()); + $this->assertSame("", $problem->getDetail()); + $this->assertSame("about:blank", $problem->getType()); + $this->assertSame("", $problem->getInstance()); + + $problem = $this->getMockForAbstractClass( + AbstractProblem::class, + ["title", "detail", "instance", "type"] + ); + + $this->assertNull($problem->getStatus()); + $this->assertSame("title", $problem->getTitle()); + $this->assertSame("detail", $problem->getDetail()); + $this->assertSame("type", $problem->getType()); + $this->assertSame("instance", $problem->getInstance()); + + $this->assertEquals([ + "title" => "title", + "detail" => "detail", + "type" => "type", + "instance" => "instance" + ], $problem->toJson()); + } + + + /** + * Tests bad method call exception for magic method. + * @noinspection PhpUndefinedMethodInspection + */ + public function testBadMethodCallException() + { + $this->expectException(BadMethodCallException::class); + + $problem = $this->getMockForAbstractClass(AbstractProblem::class); + $problem->foo(); + } +} diff --git a/tests/JsonProblem/BadRequestProblemTest.php b/tests/Http/Json/Problem/BadRequestProblemTest.php similarity index 90% rename from tests/JsonProblem/BadRequestProblemTest.php rename to tests/Http/Json/Problem/BadRequestProblemTest.php index 339456af..06af3cb7 100644 --- a/tests/JsonProblem/BadRequestProblemTest.php +++ b/tests/Http/Json/Problem/BadRequestProblemTest.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\JsonProblem; +namespace Tests\Conjoon\Http\Json\Problem; -use Conjoon\JsonProblem\BadRequestProblem; -use Conjoon\JsonProblem\AbstractProblem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Json\Problem\BadRequestProblem; +use Conjoon\Http\Json\Problem\AbstractProblem; +use Conjoon\Http\Status\StatusCodes as Status; use Tests\TestCase; /** diff --git a/tests/JsonProblem/InternalServerErrorProblemTest.php b/tests/Http/Json/Problem/InternalServerErrorProblemTest.php similarity index 85% rename from tests/JsonProblem/InternalServerErrorProblemTest.php rename to tests/Http/Json/Problem/InternalServerErrorProblemTest.php index c83ac82b..35c89122 100644 --- a/tests/JsonProblem/InternalServerErrorProblemTest.php +++ b/tests/Http/Json/Problem/InternalServerErrorProblemTest.php @@ -27,15 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\JsonProblem; +namespace Tests\Conjoon\Http\Json\Problem; -use Conjoon\JsonProblem\InternalServerErrorProblem; -use Conjoon\JsonProblem\AbstractProblem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Json\Problem\InternalServerErrorProblem; +use Conjoon\Http\Json\Problem\AbstractProblem; +use Conjoon\Http\Status\StatusCodes as Status; use Tests\TestCase; /** - * Class InternalServerErrorProblem. + * Class InternalServerErrorProblem + * @package Tests\Conjoon\Http\Json\Problem */ class InternalServerErrorProblemTest extends TestCase { diff --git a/tests/JsonProblem/MethodNotAllowedProblemTest.php b/tests/Http/Json/Problem/MethodNotAllowedProblemTest.php similarity index 85% rename from tests/JsonProblem/MethodNotAllowedProblemTest.php rename to tests/Http/Json/Problem/MethodNotAllowedProblemTest.php index 0915dab4..2c62b5db 100644 --- a/tests/JsonProblem/MethodNotAllowedProblemTest.php +++ b/tests/Http/Json/Problem/MethodNotAllowedProblemTest.php @@ -27,15 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\JsonProblem; +namespace Tests\Conjoon\Http\Json\Problem; -use Conjoon\JsonProblem\MethodNotAllowedProblem; -use Conjoon\JsonProblem\AbstractProblem; -use Conjoon\Http\StatusCodes as Status; +use Conjoon\Http\Json\Problem\MethodNotAllowedProblem; +use Conjoon\Http\Json\Problem\AbstractProblem; +use Conjoon\Http\Status\StatusCodes as Status; use Tests\TestCase; /** - * Class MethodNotAllowedProblemTest. + * Class MethodNotAllowedProblemTest + * @package Tests\Conjoon\Http\Json\Problem */ class MethodNotAllowedProblemTest extends TestCase { diff --git a/tests/JsonProblem/ProblemFactoryTest.php b/tests/Http/Json/Problem/ProblemFactoryTest.php similarity index 67% rename from tests/JsonProblem/ProblemFactoryTest.php rename to tests/Http/Json/Problem/ProblemFactoryTest.php index 0b6cf372..a5612d6b 100644 --- a/tests/JsonProblem/ProblemFactoryTest.php +++ b/tests/Http/Json/Problem/ProblemFactoryTest.php @@ -27,20 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\JsonProblem; +namespace Tests\Conjoon\Http\Json\Problem; -use Conjoon\JsonProblem\ForbiddenProblem; -use Conjoon\JsonProblem\InternalServerErrorProblem; -use Conjoon\JsonProblem\NotFoundProblem; -use Conjoon\JsonProblem\Problem; -use Conjoon\JsonProblem\BadRequestProblem; -use Conjoon\JsonProblem\MethodNotAllowedProblem; -use Conjoon\JsonProblem\ProblemFactory; -use Conjoon\JsonProblem\UnauthorizedProblem; +use Conjoon\Http\Json\Problem\InternalServerErrorProblem; +use Conjoon\Http\Json\Problem\Problem; +use Conjoon\Http\Json\Problem\BadRequestProblem; +use Conjoon\Http\Json\Problem\MethodNotAllowedProblem; +use Conjoon\Http\Json\Problem\ProblemFactory; use Tests\TestCase; /** - * Class ProblemFactoryTest. + * Class ProblemFactoryTest + * @package Tests\Conjoon\Http\Json\Problem */ class ProblemFactoryTest extends TestCase { @@ -54,22 +52,6 @@ public function testMake() $this->assertSame("title", $problem->getTitle()); $this->assertSame("detail", $problem->getDetail()); - $problem = ProblemFactory::make(401, "title", "detail"); - $this->assertInstanceOf(UnauthorizedProblem::class, $problem); - $this->assertSame("title", $problem->getTitle()); - $this->assertSame("detail", $problem->getDetail()); - - $problem = ProblemFactory::make(403, "title", "detail"); - $this->assertInstanceOf(ForbiddenProblem::class, $problem); - $this->assertSame("title", $problem->getTitle()); - $this->assertSame("detail", $problem->getDetail()); - - - $problem = ProblemFactory::make(404, "title", "detail"); - $this->assertInstanceOf(NotFoundProblem::class, $problem); - $this->assertSame("title", $problem->getTitle()); - $this->assertSame("detail", $problem->getDetail()); - $problem = ProblemFactory::make(405, "title", "detail"); $this->assertInstanceOf(MethodNotAllowedProblem::class, $problem); $this->assertSame("title", $problem->getTitle()); @@ -85,4 +67,25 @@ public function testMake() $this->assertSame("title", $problem->getTitle()); $this->assertSame("detail", $problem->getDetail()); } + + /** + * test makeJson() + */ + public function testMakeJson() + { + $statuses = [400, 405, 500, 123442]; + + foreach ($statuses as $status) { + $problem = ProblemFactory::makeJson($status, "title", "detail"); + $this->assertIsArray($problem[0]); + $this->assertSame( + ProblemFactory::make($status, "title", "detail")->toJson(), + $problem[0] + ); + $this->assertSame( + $status, + $problem[1] + ); + } + } } diff --git a/tests/JsonProblem/ProblemTest.php b/tests/Http/Json/Problem/ProblemTest.php similarity index 90% rename from tests/JsonProblem/ProblemTest.php rename to tests/Http/Json/Problem/ProblemTest.php index 5857daea..3d4e0db0 100644 --- a/tests/JsonProblem/ProblemTest.php +++ b/tests/Http/Json/Problem/ProblemTest.php @@ -27,14 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\JsonProblem; +namespace Tests\Conjoon\Http\Json\Problem; -use Conjoon\JsonProblem\AbstractProblem; -use Conjoon\JsonProblem\Problem; +use Conjoon\Http\Json\Problem\AbstractProblem; +use Conjoon\Http\Json\Problem\Problem; use Tests\TestCase; /** - * Class ProblemTest. + * Class ProblemTest + * @package Tests\Conjoon\Http\Json\Problem */ class ProblemTest extends TestCase { diff --git a/tests/Math/InvalidOperationExceptionTest.php b/tests/Http/Query/InvalidParameterResourceExceptionTest.php similarity index 70% rename from tests/Math/InvalidOperationExceptionTest.php rename to tests/Http/Query/InvalidParameterResourceExceptionTest.php index 4d23d8ab..8c7e7e56 100644 --- a/tests/Math/InvalidOperationExceptionTest.php +++ b/tests/Http/Query/InvalidParameterResourceExceptionTest.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,16 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\Math; +namespace Tests\Conjoon\Http\Query; -use Conjoon\Math\InvalidOperationException; -use RuntimeException; +use Conjoon\Http\Exception\InternalServerErrorException; +use Conjoon\Http\Query\InvalidParameterResourceException; use Tests\TestCase; /** - * Tests InvalidOperationExceptionTest. + * Class InvalidParameterResourceExceptionTest + * @package Tests\Conjoon\Http\Query */ -class InvalidOperationExceptionTest extends TestCase +class InvalidParameterResourceExceptionTest extends TestCase { /** * test instance @@ -44,8 +45,8 @@ class InvalidOperationExceptionTest extends TestCase public function testInstance() { - $exception = new InvalidOperationException(); + $exception = new InvalidParameterResourceException(); - $this->assertInstanceOf(RuntimeException::class, $exception); + $this->assertInstanceOf(InternalServerErrorException::class, $exception); } } diff --git a/tests/Web/Validation/Exception/InvalidQueryExceptionTest.php b/tests/Http/Query/InvalidQueryExceptionTest.php similarity index 76% rename from tests/Web/Validation/Exception/InvalidQueryExceptionTest.php rename to tests/Http/Query/InvalidQueryExceptionTest.php index 82181e87..a043afd1 100644 --- a/tests/Web/Validation/Exception/InvalidQueryExceptionTest.php +++ b/tests/Http/Query/InvalidQueryExceptionTest.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,25 +27,26 @@ declare(strict_types=1); -namespace Tests\Web\Validation\Exception; +namespace Tests\Conjoon\Http\Query; -use Conjoon\Web\Validation\Exception\InvalidQueryException; -use Conjoon\Web\Validation\Exception\QueryException; +use Conjoon\Http\Exception\BadRequestException; +use Conjoon\Http\Query\InvalidQueryException; use Tests\TestCase; /** - * Class InvalidQueryExceptionTest. + * Class MailClientExceptionTest + * @package Tests\Conjoon\Mail\Client */ class InvalidQueryExceptionTest extends TestCase { /** * test instance */ - public function testInstance(): void + public function testInstance() { $exception = new InvalidQueryException(); - $this->assertInstanceOf(QueryException::class, $exception); + $this->assertInstanceOf(BadRequestException::class, $exception); } } diff --git a/tests/Web/Validation/Exception/InvalidQueryParameterExceptionTest.php b/tests/Http/Query/InvalidQueryParameterExceptionTest.php similarity index 76% rename from tests/Web/Validation/Exception/InvalidQueryParameterExceptionTest.php rename to tests/Http/Query/InvalidQueryParameterExceptionTest.php index f2f19e2d..58782b9c 100644 --- a/tests/Web/Validation/Exception/InvalidQueryParameterExceptionTest.php +++ b/tests/Http/Query/InvalidQueryParameterExceptionTest.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,25 +27,26 @@ declare(strict_types=1); -namespace Tests\Web\Validation\Exception; +namespace Tests\Conjoon\Http\Query; -use Conjoon\Web\Validation\Exception\InvalidQueryParameterException; -use Conjoon\Web\Validation\Exception\QueryException; +use Conjoon\Http\Exception\BadRequestException; +use Conjoon\Http\Query\InvalidQueryParameterException; use Tests\TestCase; /** - * Class InvalidQueryParameterExceptionTest. + * Class MailClientExceptionTest + * @package Tests\Conjoon\Mail\Client */ class InvalidQueryParameterExceptionTest extends TestCase { /** * test instance */ - public function testInstance(): void + public function testInstance() { $exception = new InvalidQueryParameterException(); - $this->assertInstanceOf(QueryException::class, $exception); + $this->assertInstanceOf(BadRequestException::class, $exception); } } diff --git a/tests/Http/Query/QueryTranslatorTest.php b/tests/Http/Query/QueryTranslatorTest.php new file mode 100644 index 00000000..1d8e64fc --- /dev/null +++ b/tests/Http/Query/QueryTranslatorTest.php @@ -0,0 +1,142 @@ +getQueryTranslator(); + $parameterResource = $this->getParameterResource(); + $paramBag = new ParameterBag($parameterResource->getParameters()); + $resourceQuery = $this->getResourceQuery($paramBag); + + $translator->expects($this->once()) + ->method("extractParameters") + ->with($parameterResource) + ->willReturn($parameterResource->getParameters()); + + $translator->expects($this->once()) + ->method("getExpectedParameters") + ->willReturn(["foo", "bar"]); + + $translator->expects($this->once()) + ->method("translateParameters") + ->with( + $this->callback( + function ($bag) use ($paramBag, $parameterResource) { + $this->assertSame($paramBag->toJson(), $bag->toJson()); + $this->assertSame($parameterResource->getParameters(), $bag->toJson()); + return true; + } + ) + ) + ->willReturn($resourceQuery); + + $this->assertSame($resourceQuery, $translator->translate($parameterResource)); + } + + + /** + * + */ + public function testValidateParametersThrows() + { + $this->expectException(InvalidQueryParameterException::class); + + $translator = $this->getQueryTranslator(); + $parameterResource = $this->getParameterResource(); + + $translator->expects($this->once()) + ->method("extractParameters") + ->with($parameterResource) + ->willReturn($parameterResource->getParameters()); + + $translator->expects($this->once()) + ->method("getExpectedParameters") + ->willReturn(["nono", "bar"]); + + $translator->translate($parameterResource); + } + + + /** + * @param ParameterBag $bag + * @return ResourceQuery + */ + protected function getResourceQuery(ParameterBag $bag): ResourceQuery + { + return new class ($bag) extends ResourceQuery { + }; + } + + + /** + * @return object + */ + protected function getParameterResource(): object + { + return new class { + public function getParameters(): array + { + return [ + "foo" => 1, + "bar" => 2 + ]; + } + }; + } + + + /** + * + * @return QueryTranslator|MockObject + */ + protected function getQueryTranslator(): MockObject + { + return $this->getMockForAbstractClass( + QueryTranslator::class + ); + } +} diff --git a/tests/Http/RequestMethodTest.php b/tests/Http/RequestMethodTest.php deleted file mode 100644 index eb53adf3..00000000 --- a/tests/Http/RequestMethodTest.php +++ /dev/null @@ -1,83 +0,0 @@ -getValues(); - - $this->assertSame(count($values), count(RequestMethod::cases())); - - $this->assertEqualsCanonicalizing( - array_map( - function ($method) { - return constant(RequestMethod::class . "::$method"); - }, - $this->getValues() - ), - RequestMethod::cases() - ); - - foreach ($values as $method) { - /** - * @var RequestMethod $enum - */ - $enum = constant(RequestMethod::class . "::$method"); - $this->assertSame($method, $enum->value); - } - } - - - /** - * @return string[] - */ - protected function getValues(): array - { - return ["GET","HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]; - } -} diff --git a/tests/Http/RequestTest.php b/tests/Http/RequestTest.php deleted file mode 100644 index 6775e685..00000000 --- a/tests/Http/RequestTest.php +++ /dev/null @@ -1,71 +0,0 @@ -assertSame($url, $request->getUrl()); - $this->assertSame(RequestMethod::GET, $request->getMethod()); - - $request = new Request($url, RequestMethod::POST); - $this->assertSame(RequestMethod::POST, $request->getMethod()); - } - - - public function testGetQuery(): void - { - $request = new Request(Url::create("https://www.localhost.com:8080/index.php")); - $this->assertNull($request->getQuery()); - - $request = new Request(Url::create("https://www.localhost.com:8080/index.php?query=value")); - $query = $request->getQuery(); - $this->assertNotNull($query); - $this->assertSame( - ["query" => "value"], - $query->toArray() - ); - } -} diff --git a/tests/Http/StatusCodesTest.php b/tests/Http/Status/StatusCodesTest.php similarity index 79% rename from tests/Http/StatusCodesTest.php rename to tests/Http/Status/StatusCodesTest.php index 6625e8a1..4f2df499 100644 --- a/tests/Http/StatusCodesTest.php +++ b/tests/Http/Status/StatusCodesTest.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Tests\Conjoon\Http; +namespace Tests\Conjoon\Http\Status; -use Conjoon\Http\StatusCodes; +use Conjoon\Http\Status\StatusCodes; use Tests\TestCase; /** @@ -41,20 +41,14 @@ class StatusCodesTest extends TestCase /** * test class */ - public function testClass(): void + public function testClass() { $this->assertSame(400, StatusCodes::HTTP_400); - $this->assertSame(401, StatusCodes::HTTP_401); - $this->assertSame(403, StatusCodes::HTTP_403); - $this->assertSame(404, StatusCodes::HTTP_404); $this->assertSame(405, StatusCodes::HTTP_405); $this->assertSame(500, StatusCodes::HTTP_500); $this->assertIsString(StatusCodes::HTTP_STATUS[400]); - $this->assertIsString(StatusCodes::HTTP_STATUS[401]); - $this->assertIsString(StatusCodes::HTTP_STATUS[403]); - $this->assertIsString(StatusCodes::HTTP_STATUS[404]); $this->assertIsString(StatusCodes::HTTP_STATUS[405]); $this->assertIsString(StatusCodes::HTTP_STATUS[500]); } diff --git a/tests/Illuminate/Auth/Imap/DefaultImapUserProviderTest.php b/tests/Illuminate/Auth/Imap/DefaultImapUserProviderTest.php index fe75e735..cb5f56a5 100644 --- a/tests/Illuminate/Auth/Imap/DefaultImapUserProviderTest.php +++ b/tests/Illuminate/Auth/Imap/DefaultImapUserProviderTest.php @@ -32,7 +32,7 @@ use Conjoon\Illuminate\Auth\Imap\DefaultImapUserProvider; use Conjoon\Illuminate\Auth\Imap\ImapUser; use Conjoon\Illuminate\Auth\Imap\ImapUserProvider; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; use Tests\TestCase; /** diff --git a/tests/Illuminate/Auth/Imap/ImapUserTest.php b/tests/Illuminate/Auth/Imap/ImapUserTest.php index 54872cb8..1d9777c7 100644 --- a/tests/Illuminate/Auth/Imap/ImapUserTest.php +++ b/tests/Illuminate/Auth/Imap/ImapUserTest.php @@ -30,7 +30,7 @@ namespace Tests\Conjoon\Illuminate\Auth\Imap; use Conjoon\Illuminate\Auth\Imap\ImapUser; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; use Illuminate\Contracts\Auth\Authenticatable; use Tests\TestCase; diff --git a/tests/Illuminate/Auth/Imap/UtilTest.php b/tests/Illuminate/Auth/Imap/UtilTest.php index c2f9bede..a633ddac 100644 --- a/tests/Illuminate/Auth/Imap/UtilTest.php +++ b/tests/Illuminate/Auth/Imap/UtilTest.php @@ -32,7 +32,7 @@ namespace Tests\Conjoon\Illuminate\Auth\Imap; use Conjoon\Illuminate\Auth\Imap\Util; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; use Tests\TestCase; class UtilTest extends TestCase diff --git a/tests/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformerTest.php b/tests/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformerTest.php index d8465aca..ac4ca9fa 100644 --- a/tests/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformerTest.php +++ b/tests/Illuminate/Mail/Client/Request/Attachment/Transformer/LaravelAttachmentListJsonTransformerTest.php @@ -27,19 +27,19 @@ declare(strict_types=1); -namespace Tests\Conjoon\Illuminate\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Tests\Conjoon\Illuminate\Mail\Client\Request\Attachment\Transformer; -use Conjoon\Illuminate\MailClient\Data\Protocol\Http\Request\Transformer\LaravelAttachmentListJsonTransformer; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\Protocol\Http\Request\Transformer\AttachmentListJsonTransformer; -use Conjoon\Core\Contract\JsonDecodable; +use Conjoon\Illuminate\Mail\Client\Request\Attachment\Transformer\LaravelAttachmentListJsonTransformer; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Request\Attachment\Transformer\AttachmentListJsonTransformer; +use Conjoon\Util\JsonDecodable; use Illuminate\Http\UploadedFile; use RuntimeException; use Tests\TestCase; /** * Class LaravelAttachmentListJsonTransformerTest - * @package Tests\Conjoon\Illuminate\MailClient\Data\Protocol\Http\Request\Transformer + * @package Tests\Conjoon\Illuminate\Mail\Client\Request\Attachment\Transformer */ class LaravelAttachmentListJsonTransformerTest extends TestCase { diff --git a/tests/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRuleTest.php b/tests/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRuleTest.php deleted file mode 100644 index 2e962cde..00000000 --- a/tests/JsonApi/Extensions/Query/Validation/Parameter/RelfieldRuleTest.php +++ /dev/null @@ -1,304 +0,0 @@ -getResourceObjectDescriptionList(); - $includes = $this->getIncludes(); - $rule = new RelfieldRule($list, $includes); - $this->assertInstanceOf(FieldsetRule::class, $rule); - - $wildcardEnabled = $this->makeAccessible($rule, "wildcardEnabled", true); - - $this->assertFalse($wildcardEnabled->getValue($rule)); - } - - - /** - * tests supports() - */ - public function testSupports() - { - $includes = $this->getIncludes(); - $rule = new RelfieldRule($this->getResourceObjectDescriptionList(), $includes); - - $this->assertTrue($rule->supports(new Parameter("relfield:fields[MessageItem]", ""))); - $this->assertFalse($rule->supports(new Parameter("field[MessageItem]", ""))); - $this->assertFalse($rule->supports(new Parameter("fields", ""))); - } - - - /** - * tests validate() with empty fieldset "relfield:fields[MessageItem]=" - */ - public function testValidateWithEmptyRelfield() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", ""); - $this->assertTrue($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * tests validate() with wildcard only "relfield:fields[MessageItem]=*" - */ - public function testValidateWithWildcardOnly() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "*"); - $this->assertTrue($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * tests validate() with enableWildcard=false, wildcard only "relfield:fields[MessageItem]=*" - */ - public function testValidateWithWildcardNotEnabled() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(false); - - $parameter = new Parameter("relfield:fields[MessageItem]", "*"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - $this->assertStringContainsString( - "does not support wildcards", - $errors[0]->getDetails() - ); - } - - - /** - * tests validate() with wildcard and valid fields "relfield:fields[MessageItem]=*,+previewText,+date" - */ - public function testValidateWithWildcardAndValidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "*,+previewText,+date"); - $this->assertTrue($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * tests validate() with wildcard and invalid fields "relfield:fields[MessageItem]=+MailFolder,*,-date" - */ - public function testValidateWithWildcardAndInvalidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "*,+MailFolder,-date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - - $this->assertInstanceOf(ValidationError::class, $errors[0]); - $this->assertStringContainsString( - "The following fields for \"relfield:fields[MessageItem]\" cannot be found", - $errors[0]->getDetails() - ); - $this->assertSame(400, $errors[0]->getCode()); - $this->assertSame($parameter, $errors[0]->getSource()); - } - - - /** - * tests validate() with invalid fields "relfield:fields[MessageItem]=+MailFolder,-date" - */ - public function testValidateWithInvalidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "+MailFolder,-date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - - $this->assertInstanceOf(ValidationError::class, $errors[0]); - $this->assertStringContainsString( - "The following fields for \"relfield:fields[MessageItem]\" cannot be found", - $errors[0]->getDetails() - ); - $this->assertSame(400, $errors[0]->getCode()); - $this->assertSame($parameter, $errors[0]->getSource()); - } - - - /** - * tests validate() with valid fields "relfield:fields[MessageItem]=+subject,+date" - */ - public function testValidateWithValidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "+subject,+date"); - $this->assertTrue($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * tests validate() with missing prefix "relfield:fields[MessageItem]=+subject,date" - */ - public function testValidateWithValidFieldsButMissingPrefix() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "+subject,date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - - $this->assertStringContainsString( - "expects each field to be prefixed", - $errors[0]->getDetails() - ); - } - - - /** - * tests validate() with missing prefixes for all fields, which - * should fall back to default sparse fieldset behavior "relfield:fields[MessageItem]=subject,date" - */ - public function testValidateWithValidFieldsAndAllMissingPrefixes() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "subject,date"); - $this->assertFalse( - $validate->invokeArgs($rule, [$parameter, $errors]) - ); - } - - - /** - * tests validate() with missing prefixes for all fields, but with wildcard - * "relfield:fields[MessageItem]=*,subject,date" - */ - public function testValidateWithValidFieldsAndAllMissingPrefixesAndWildcard() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "*,subject,date"); - $this->assertFalse( - $validate->invokeArgs($rule, [$parameter, $errors]) - ); - $this->assertStringContainsString( - "each field to be prefixed", - $errors[0]->getDetails() - ); - } - - - /** - * tests validate() with multiple wildcards "relfield:fields[MessageItem]=*,+subject,*,-date" - */ - public function testValidateWithMultipleWildcards() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("relfield:fields[MessageItem]", "*,+subject,*,-date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - - $this->assertStringContainsString( - "does not allow more than one wildcard for \"relfield:fields[MessageItem]\"", - $errors[0]->getDetails() - ); - } - - - /** - * @return ObjectDescriptionList - */ - protected function getResourceObjectDescriptionList(): ObjectDescriptionList - { - $list = new ObjectDescriptionList(); - - $messageItem = $this->createMockForAbstract(ObjectDescription::class, ["getType", "getFields"]); - $messageItem->expects($this->any())->method("getType")->willReturn("MessageItem"); - $messageItem->expects($this->any())->method("getFields")->willReturn([ - "subject", "date", "from", "to", "previewText" - ]); - - $mailFolder = $this->createMockForAbstract(ObjectDescription::class, ["getType", "getFields"]); - $mailFolder->expects($this->any())->method("getType")->willReturn("MailFolder"); - $mailFolder->expects($this->any())->method("getFields")->willReturn([ - "name", "type", "id" - ]); - - $list[] = $messageItem; - $list[] = $mailFolder; - - return $list; - } - - - /** - * @return string[] - */ - protected function getIncludes() - { - return ["MailFolder", "MessageItem"]; - } - - - /** - * @return array - * @throws ReflectionException - */ - protected function getValidateTestSetup(bool $enableWildcard = true): array - { - $errors = new ValidationErrors(); - $includes = $this->getIncludes(); - $list = $this->getResourceObjectDescriptionList(); - $rule = new RelfieldRule($list, $includes, $enableWildcard); - $validate = $this->makeAccessible($rule, "validate"); - - return [ - "includes" => $includes, - "errors" => $errors, - "list" => $list, - "rule" => $rule, - "validate" => $validate - ]; - } -} diff --git a/tests/JsonApi/Query/QueryTest.php b/tests/JsonApi/Query/QueryTest.php deleted file mode 100644 index 2a745247..00000000 --- a/tests/JsonApi/Query/QueryTest.php +++ /dev/null @@ -1,82 +0,0 @@ -createTestInstance(); - $this->assertInstanceOf(Query::class, $query); - } - - - /** - * Tests getResourceTarget() - */ - public function testGetResourceTarget() - { - $resourceTarget = $this->createMockForAbstract(ObjectDescription::class); - $query = new JsonApiQuery("", $resourceTarget); - $this->assertSame($resourceTarget, $query->getResourceTarget()); - } - - - /** - * @param null $queryString - * @return Query - */ - protected function createTestInstance($queryString = null): Query - { - $resourceTarget = $this->createMockForAbstract(ObjectDescription::class); - return new JsonApiQuery($queryString ?? "", $resourceTarget); - } - - - /** - * @return string - */ - protected function getTestedClass(): string - { - return JsonApiQuery::class; - } -} diff --git a/tests/JsonApi/Query/Validation/CollectionValidatorTest.php b/tests/JsonApi/Query/Validation/CollectionValidatorTest.php deleted file mode 100644 index 39c60ccf..00000000 --- a/tests/JsonApi/Query/Validation/CollectionValidatorTest.php +++ /dev/null @@ -1,194 +0,0 @@ -assertInstanceOf(Validator::class, $validator); - } - - /** - * tests getAvailableFields - */ - public function testGetAvailableFields() - { - $validator = new CollectionValidator(); - $getAvailableFields = $this->makeAccessible($validator, "getAvailableFields"); - $resourceTarget = $this->createMockForAbstract( - ObjectDescription::class, - [ - "getType", "getFields", "getAllRelationshipResourceDescriptions" - ] - ); - - $resourceTargetChild = $this->createMockForAbstract( - ObjectDescription::class, - ["getFields", "getType"] - ); - $resourceTarget->expects($this->once())->method("getType")->willReturn("MessageItem"); - $resourceTarget->expects($this->exactly(2))->method("getFields")->willReturn( - ["subject", "date", "size"] - ); - - $resourceTargetChild->expects($this->once())->method("getType")->willReturn("MailFolder"); - $resourceTargetChild->expects($this->once())->method("getFields")->willReturn( - ["unreadMessages", "totalMessages"] - ); - - $resourceTargetList = new ObjectDescriptionList(); - $resourceTargetList[] = $resourceTarget; - $resourceTargetList[] = $resourceTargetChild; - - $resourceTarget->expects($this->once()) - ->method("getAllRelationshipResourceDescriptions") - ->with(true) - ->willReturn($resourceTargetList); - - - $fields = [ - "subject", "date", "size", - "MessageItem.subject", "MessageItem.date", "MessageItem.size", - "MailFolder.unreadMessages", "MailFolder.totalMessages" - ]; - - $this->assertEqualsCanonicalizing( - $fields, - $getAvailableFields->invokeArgs($validator, [$resourceTarget]) - ); - } - - - /** - * tests getAvailableSortFields - */ - public function testGetAvailableSortFields() - { - $fields = [ - "subject", "date", "size", - "MessageItem.subject", "MessageItem.date", "MessageItem.size", - "MailFolder.unreadMessages", "MailFolder.totalMessages" - ]; - - $sortFields = array_merge($fields, array_map(fn ($field) => "-" . $field, $fields)); - - $validator = $this->getMockBuilder(CollectionValidator::class) - ->disableOriginalConstructor() - ->onlyMethods(["getAvailableFields"]) - ->getMock(); - - $getAvailableSortFields = $this->makeAccessible($validator, "getAvailableSortFields"); - $validator->expects($this->once())->method("getAvailableFields")->willReturn( - $fields - ); - - $resourceTarget = $this->createMockForAbstract(ObjectDescription::class); - - $this->assertEqualsCanonicalizing( - $sortFields, - $getAvailableSortFields->invokeArgs($validator, [$resourceTarget]) - ); - } - - - /** - * test getAllowedParameterNames() - */ - public function getAllowedParameterNames() - { - $validator = new CollectionValidator(); - - $query = $this->getMockBuilder(Query::class) - ->disableOriginalConstructor() - ->onlyMethods(["getResourceTarget"])->getMock(); - - $resourceTarget = $this->createMockForAbstract(ObjectDescription::class, [ - ]); - $query->expects($this->any())->method("getResourceTarget")->willReturn($resourceTarget); - - - $this->assertContains( - "sort", - $validator->getAllowedParameterNames($query) - ); - } - - - /** - * test getParameterRules() - */ - public function testGetParameterRules() - { - $sort = ["date", "subject", "size"]; - $sortParameter = new Parameter("sort", "-date,subject"); - $objectDescriptionList = new ObjectDescriptionList(); - - $query = $this->getMockBuilder(Query::class) - ->disableOriginalConstructor() - ->onlyMethods(["getParameter", "getResourceTarget"]) - ->getMock(); - - $resourceTarget = $this->createMockForAbstract( - ObjectDescription::class, - ["getAllRelationshipPaths", "getAllRelationshipResourceDescriptions"] - ); - - $query->expects($this->any())->method("getResourceTarget")->willReturn($resourceTarget); - $query->expects($this->any()) - ->method("getParameter") - ->withConsecutive(["sort"], ["include"]) - ->willReturnOnConsecutiveCalls($sortParameter, new Parameter("include", "")); - - $validator = $this->createMockForAbstract(CollectionValidator::class, ["getAvailableSortFields"]); - $validator->expects($this->once())->method("getAvailableSortFields")->willReturn($sort); - - $rules = $validator->getParameterRules($query); - - $this->assertInstanceOf(ValuesInWhitelistRule::class, $rules->peek()); - $this->assertSame($sort, $rules->peek()->getWhitelist()); - } -} diff --git a/tests/JsonApi/Query/Validation/Parameter/FieldsetRuleTest.php b/tests/JsonApi/Query/Validation/Parameter/FieldsetRuleTest.php deleted file mode 100644 index ad1b913d..00000000 --- a/tests/JsonApi/Query/Validation/Parameter/FieldsetRuleTest.php +++ /dev/null @@ -1,284 +0,0 @@ -getResourceObjectDescriptionList(); - $includes = $this->getIncludes(); - $rule = new FieldsetRule($list, $includes); - $this->assertInstanceOf(ParameterRule::class, $rule); - - $uses = class_uses(FieldsetRule::class); - $this->assertContains(ParameterTrait::class, $uses); - - $this->assertSame($list, $rule->getResourceObjectDescriptions()); - $this->assertSame($includes, $rule->getIncludes()); - } - - - /** - * tests supports() - */ - public function testSupports() - { - $includes = $this->getIncludes(); - $rule = new FieldsetRule($this->getResourceObjectDescriptionList(), $includes); - - $this->assertTrue($rule->supports(new Parameter("fields[MessageItem]", ""))); - $this->assertFalse($rule->supports(new Parameter("field[MessageItem]", ""))); - $this->assertFalse($rule->supports(new Parameter("fields", ""))); - } - - - /** - * tests getFields() - */ - public function testGetFields() - { - $includes = $this->getIncludes(); - $list = $this->getResourceObjectDescriptionList(); - $rule = new FieldsetRule($list, $includes); - $getFields = $this->makeAccessible($rule, "getFields"); - - $this->assertEquals( - ["subject", "date", "from", "to", "previewText"], - $getFields->invokeArgs($rule, ["MessageItem"]) - ); - - $this->assertNull( - $getFields->invokeArgs($rule, ["NotAvailabe"]) - ); - } - - /** - * tests validate() with missing include "fields[unknown]=field1,field2" - */ - public function testValidateWithMissingInclude() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[unknown]", "field1,field2"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - $this->assertInstanceOf(ValidationError::class, $errors[0]); - $this->assertStringContainsString( - "The requested type \"unknown\" cannot be found in the list of includes", - $errors[0]->getDetails() - ); - $this->assertSame(400, $errors[0]->getCode()); - $this->assertSame($parameter, $errors[0]->getSource()); - } - /** - * tests validate() with key for fieldset that is not available in relationships "fields[unknown]=field1,field2" - */ - public function testValidateWithUnknownType() - { - $errors = new ValidationErrors(); - $includes = array_merge(["unknown"], $this->getIncludes()); - $list = $this->getResourceObjectDescriptionList(); - $rule = new FieldsetRule($list, $includes); - $validate = $this->makeAccessible($rule, "validate"); - - $parameter = new Parameter("fields[unknown]", "field1,field2"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - $this->assertInstanceOf(ValidationError::class, $errors[0]); - $this->assertStringContainsString( - "Cannot find fields for parameter \"fields[unknown]\"", - $errors[0]->getDetails() - ); - $this->assertSame(400, $errors[0]->getCode()); - $this->assertSame($parameter, $errors[0]->getSource()); - } - - - /** - * tests validate() with empty fieldset "fields[MessageItem]=" - */ - public function testValidateWithEmptyFieldset() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[MessageItem]", ""); - $this->assertTrue($validate->invokeArgs($rule, [$parameter, $errors])); - } - - /** - * tests validate() with wildcard only "fields[MessageItem]=*" - * @note Wildcard moved to relfield-extension - */ - public function testValidateWithWildcardOnly() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[MessageItem]", "*"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * tests validate() with wildcard and valid fields "fields[MessageItem]=*,previewText,date" - * @note Wildcard moved to relfield-extension - */ - public function testValidateWithWildcardAndValidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[MessageItem]", "*,previewText,date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * tests validate() with wildcard and invalid fields "fields[MessageItem]=MailFolder,date" - */ - public function testValidateWithWildcardAndInvalidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[MessageItem]", "MailFolder,date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - - $this->assertInstanceOf(ValidationError::class, $errors[0]); - $this->assertStringContainsString( - "The following fields for \"fields[MessageItem]\" cannot be found", - $errors[0]->getDetails() - ); - $this->assertSame(400, $errors[0]->getCode()); - $this->assertSame($parameter, $errors[0]->getSource()); - } - - - /** - * tests validate() with invalid fields "fields[MessageItem]=MailFolder,date" - */ - public function testValidateWithInvalidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[MessageItem]", "MailFolder,date"); - $this->assertFalse($validate->invokeArgs($rule, [$parameter, $errors])); - - $this->assertInstanceOf(ValidationError::class, $errors[0]); - $this->assertStringContainsString( - "The following fields for \"fields[MessageItem]\" cannot be found", - $errors[0]->getDetails() - ); - $this->assertSame(400, $errors[0]->getCode()); - $this->assertSame($parameter, $errors[0]->getSource()); - } - - - /** - * tests validate() with invalid fields "fields[MessageItem]=subject,date" - */ - public function testValidateWithValidFields() - { - list("errors" => $errors, "rule" => $rule, "validate" => $validate) = $this->getValidateTestSetup(); - - $parameter = new Parameter("fields[MessageItem]", "subject,date"); - $this->assertTrue($validate->invokeArgs($rule, [$parameter, $errors])); - } - - - /** - * @return ObjectDescriptionList - */ - protected function getResourceObjectDescriptionList(): ObjectDescriptionList - { - $list = new ObjectDescriptionList(); - - $messageItem = $this->createMockForAbstract(ObjectDescription::class, ["getType", "getFields"]); - $messageItem->expects($this->any())->method("getType")->willReturn("MessageItem"); - $messageItem->expects($this->any())->method("getFields")->willReturn([ - "subject", "date", "from", "to", "previewText" - ]); - - $mailFolder = $this->createMockForAbstract(ObjectDescription::class, ["getType", "getFields"]); - $mailFolder->expects($this->any())->method("getType")->willReturn("MailFolder"); - $mailFolder->expects($this->any())->method("getFields")->willReturn([ - "name", "type", "id" - ]); - - $list[] = $messageItem; - $list[] = $mailFolder; - - return $list; - } - - - /** - * @return string[] - */ - protected function getIncludes() - { - return ["MailFolder", "MessageItem"]; - } - - - /** - * @return array - * @throws ReflectionException - */ - protected function getValidateTestSetup(): array - { - $errors = new ValidationErrors(); - $includes = $this->getIncludes(); - $list = $this->getResourceObjectDescriptionList(); - $rule = new FieldsetRule($list, $includes); - $validate = $this->makeAccessible($rule, "validate"); - - return [ - "includes" => $includes, - "errors" => $errors, - "list" => $list, - "rule" => $rule, - "validate" => $validate - ]; - } -} diff --git a/tests/JsonApi/Query/Validation/Parameter/IncludeRuleTest.php b/tests/JsonApi/Query/Validation/Parameter/IncludeRuleTest.php deleted file mode 100644 index 9d826c69..00000000 --- a/tests/JsonApi/Query/Validation/Parameter/IncludeRuleTest.php +++ /dev/null @@ -1,167 +0,0 @@ -assertInstanceOf(ValueInWhitelistRule::class, $rule); - } - - - /** - * tests merge() - */ - public function testMerge() - { - $rule = new IncludeRule([]); - $merge = $this->makeAccessible($rule, "merge"); - - $tests = [ - [ - "includes" => [ - "MessageItem", - "MailFolder", - "MailFolder.MessageItem", - "MailFolder.MessageItem.Body", - "MailFolder.MailAccount" - ], - "expected" => [ - "MessageItem", - "MailFolder.MessageItem.Body", - "MailFolder.MailAccount" - ] - ], - [ - "includes" => [ - "MessageItem", - "MailFolder" - ], - "expected" => [ - "MessageItem", - "MailFolder" - ] - ], - [ - "includes" => [ - "MessageItem", - "MailFolder", - "MessageItem.Draft", - "MailFolder.MailAccount", - "MailFolder.MessageItem.Body", - "MailFolder.MailAccount.Item.Envelope" - ], - "expected" => [ - "MessageItem.Draft", - "MailFolder.MessageItem.Body", - "MailFolder.MailAccount.Item.Envelope" - ] - ], - ]; - - - foreach ($tests as $test) { - $this->assertEquals( - $test["expected"], - $merge->invokeArgs($rule, [$test["includes"]]) - ); - } - } - - - /** - * tests name for parameter for supports() - */ - public function testParameterName() - { - $rule = new IncludeRule([]); - $parameterName = $this->makeAccessible($rule, "parameterName", true); - $this->assertSame("include", $parameterName->getValue($rule)); - } - - - /** - * tests parse() - */ - public function testParse() - { - $rule = new IncludeRule([]); - $merge = $this->makeAccessible($rule, "parse"); - - $this->assertEquals( - [], - $merge->invokeArgs($rule, [""]) - ); - - $this->assertEquals( - ["MailAccount", "MailFolder"], - $merge->invokeArgs($rule, ["MailAccount,MailFolder"]) - ); - } - - - /** - * tests isParameterValueValid - */ - public function testIsParameterValueValid() - { - $rule = new IncludeRule([]); - $isParameterValueValid = $this->makeAccessible($rule, "isParameterValueValid"); - - $parameter = new Parameter("include", "MailFolder,MailFolder.MailAccount"); - - $this->assertTrue( - $isParameterValueValid->invokeArgs( - $rule, - [$parameter, ["MailFolder.MailAccount"]] - ) - ); - - $this->assertFalse( - $isParameterValueValid->invokeArgs( - $rule, - [$parameter, ["MessageItem"]] - ) - ); - } -} diff --git a/tests/JsonApi/Query/Validation/Parameter/PnFilterRuleTest.php b/tests/JsonApi/Query/Validation/Parameter/PnFilterRuleTest.php deleted file mode 100644 index 0d25dd13..00000000 --- a/tests/JsonApi/Query/Validation/Parameter/PnFilterRuleTest.php +++ /dev/null @@ -1,204 +0,0 @@ -assertInstanceOf(JsonEncodedRule::class, $rule); - - $getParameterName = $this->makeAccessible($rule, "parameterName", true); - - $this->assertSame("filter", $getParameterName->getValue($rule)); - } - - - /** - * tests getAttributes - * @return void - */ - public function testGetAttributes() - { - $attributes = ["field"]; - $rule = new PnFilterRule($attributes); - $this->assertSame($attributes, $rule->getAttributes()); - } - - - /** - * tests getRelationalOperators() - * - * @return void - */ - public function testGetRelationalOperators() - { - $operators = ["<=", "<", "!=", "=", ">", ">=", "=="]; - $rule = new PnFilterRule([]); - - $this->assertEqualsCanonicalizing( - $operators, - $rule->getRelationalOperators() - ); - } - - - /** - * test getFunctions() - * - * @return void - */ - public function testGetFunctions() - { - $functions = ["IN"]; - $rule = new PnFilterRule([]); - - $this->assertEqualsCanonicalizing( - $functions, - $rule->getFunctions() - ); - } - - - /** - * tests getLogicalOperators() - * - * @return void - */ - public function testGetLogicalOperators() - { - $operators = ["OR", "||"]; - $rule = new PnFilterRule([]); - - $this->assertEqualsCanonicalizing( - $operators, - $rule->getLogicalOperators() - ); - } - - - /** - * @return void - */ - public function testIsLogicalOperator() - { - $operators = ["||", "OR"]; - - $rule = new PnFilterRule([]); - - foreach ($operators as $operator) { - $this->assertTrue($rule->isLogicalOperator($operator)); - } - - $this->assertFalse($rule->isLogicalOperator("foo")); - } - - - - /** - * tests isValid()/validate() - * @return void - */ - public function testValidate() - { - $errors = new ValidationErrors(); - $fields = ["MessageItem.subject", "subject", "MailFolder.name", "date", "size", "id"]; - - $rule = new PnFilterRule($fields); - - $tests = [ - [ - "filter" => ["=" => ["size" => 1000]], - "result" => true - ], - [ - "filter" => ["size" => 1000], - "result" => "is not a valid operator" - ], - [ - "filter" => ["OR" => [[ "==" => ["size" => 1000]], [">" => ["date" => 127000000]]]], - "result" => true - ], - [ - "filter" => ["OR" => [[ "=" => ["size" => 1000]]]], - "result" => "expects at least 2 operands" - ], - [ - "filter" => ["OR" => [ ["=" => ["size" => 1000]], ["IN" => ["subject" => ["Hello World"]]]]], - "result" => true - ], - [ - "filter" => ["OR" => [ ["=" => ["size" => 1000]], [">" => ["IN" => ["subject" => ["Hello World"]]]]]], - "result" => "needs a valid attribute" - ], - [ - "filter" => [ - "OR" => [ - ["==" => ["id" => 4]], - ["||" => [ - ["=" => ["subject" => "Hello World"]], - [">=" => ["size" => 1657]] - ]] - ] - ], - "result" => true - ] - - ]; - - - foreach ($tests as $test) { - $filter = json_encode($test["filter"]); - $result = $test["result"]; - - $parameter = new Parameter("filter", $filter); - - if (is_string($result)) { - $this->assertFalse($rule->isValid($parameter, $errors)); - $this->assertStringContainsString($result, $errors->peek()->getDetails()); - } else { - $this->assertTrue($rule->isValid($parameter, $errors)); - } - } - } -} diff --git a/tests/JsonApi/Query/Validation/Query/QueryRuleTest.php b/tests/JsonApi/Query/Validation/Query/QueryRuleTest.php deleted file mode 100644 index 08d1f296..00000000 --- a/tests/JsonApi/Query/Validation/Query/QueryRuleTest.php +++ /dev/null @@ -1,66 +0,0 @@ -createMockForAbstract(QueryRule::class); - $this->assertInstanceOf(HttpQueryRule::class, $rule); - } - - /** - * test supports() - */ - public function testSupports() - { - $rule = $this->createMockForAbstract(QueryRule::class); - - $this->assertFalse($rule->supports(new stdClass())); - $this->assertTrue( - $rule->supports( - $this->getMockBuilder(Query::class)->disableOriginalConstructor()->getMock() - ) - ); - } -} diff --git a/tests/JsonApi/Query/Validation/TestQueryValidator.php b/tests/JsonApi/Query/Validation/TestQueryValidator.php deleted file mode 100644 index e139e2ff..00000000 --- a/tests/JsonApi/Query/Validation/TestQueryValidator.php +++ /dev/null @@ -1,39 +0,0 @@ -assertInstanceOf(HttpQueryValidator::class, $validator); - } - - /** - * tests unfold() - * @throws ReflectionException - */ - public function testUnfoldWithUnexpectedQueryParameterException() - { - $validator = new Validator(); - $unfold = $this->makeAccessible($validator, "unfoldInclude"); - $this->expectException(UnexpectedQueryParameterException::class); - - $parameter = new Parameter("parameter", ""); - $unfold->invokeArgs($validator, [$parameter]); - } - - - /** - * tests unfold() - */ - public function testUnfold() - { - $validator = new Validator(); - $unfold = $this->makeAccessible($validator, "unfoldInclude"); - $parameter = new Parameter("include", "MailFolder.MailAccount,MailFolder.MailAccount.Server,MailFolder"); - - $this->assertEquals( - ["MailFolder", "MailAccount", "Server"], - $unfold->invokeArgs($validator, [$parameter]) - ); - - $parameter = new Parameter("include", ""); - - $this->assertEquals( - [], - $unfold->invokeArgs($validator, [$parameter]) - ); - } - - - /** - * test getAllowedParameterNames() - */ - public function testGetAllowedParameterNames() - { - $validator = new Validator(); - - $query = $this->getMockBuilder(Query::class) - ->disableOriginalConstructor() - ->onlyMethods(["getResourceTarget"])->getMock(); - - $resourceTarget = $this->createMockForAbstract(ObjectDescription::class, [ - "getType", "getAllRelationshipPaths"]); - $query->expects($this->once())->method("getResourceTarget")->willReturn($resourceTarget); - - $resourceTarget->expects($this->once())->method("getAllRelationshipPaths")->with(true)->willReturn([ - "path", "entity", "path.entity2", "path.entity2.entity3" - ]); - - - $this->assertEqualsCanonicalizing([ - "include", - "fields[entity]", - "fields[path]", - "fields[entity2]", - "fields[entity3]" - ], $validator->getAllowedParameterNames($query)); - } - - - /** - * test getRequiredParameterNames() - */ - public function testGetRequiredParameterNames() - { - $validator = new Validator(); - - $query = $this->getMockBuilder(Query::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->assertEquals( - [], - $validator->getRequiredParameterNames($query) - ); - } - - - /** - * test supports() - */ - public function testSupports() - { - $validator = new Validator(); - - $this->assertTrue( - $validator->supports( - $this->getMockBuilder(Query::class)->disableOriginalConstructor()->getMock() - ) - ); - - - $this->assertFalse( - $validator->supports( - $this->getMockBuilder(HttpQuery::class)->disableOriginalConstructor()->getMock() - ) - ); - } - - - /** - * test getQueryRules() - */ - public function testGetQueryRules() - { - $allowedParameterNames = ["include"]; - $requiredParameterNames = ["include"]; - - $validator = $this->getMockBuilder(Validator::class) - ->onlyMethods(["getAllowedParameterNames", "getRequiredParameterNames"]) - ->getMock(); - - $query = $this->getMockBuilder(Query::class) - ->disableOriginalConstructor()->getMock(); - - $validator->expects($this->once())->method("getAllowedParameterNames") - ->with($query) - ->willReturn($allowedParameterNames); - - $validator->expects($this->once())->method("getRequiredParameterNames") - ->with($query) - ->willReturn($requiredParameterNames); - - - $rules = $validator->getQueryRules($query); - - $this->assertSame(2, count($rules)); - - $this->assertInstanceOf(OnlyParameterNamesRule::class, $rules[0]); - $this->assertSame($allowedParameterNames, $rules[0]->getWhitelist()); - - $this->assertInstanceOf(RequiredParameterNamesRule::class, $rules[1]); - $this->assertSame($requiredParameterNames, $rules[1]->getRequired()); - } - - - /** - * test getParameterRules() - */ - public function testGetParameterRules() - { - $includes = ["MessageItem", "MailFolder"]; - $includeParameter = new Parameter("include", "MessageItem,MailFolder"); - $whitelist = ["fields[MessageItem]"]; - $objectDescriptionList = new ObjectDescriptionList(); - - $query = $this->getMockBuilder(Query::class) - ->disableOriginalConstructor() - ->onlyMethods(["getParameter", "getResourceTarget"]) - ->getMock(); - - $resourceTarget = $this->createMockForAbstract( - ObjectDescription::class, - ["getAllRelationshipPaths", "getAllRelationshipResourceDescriptions"] - ); - - $query->expects($this->once())->method("getResourceTarget")->willReturn($resourceTarget); - $query->expects($this->exactly(1)) - ->method("getParameter") - ->withConsecutive(["include"]) - ->willReturnOnConsecutiveCalls($includeParameter); - - $resourceTarget->expects($this->once())->method("getAllRelationshipPaths")->willReturn( - $whitelist - ); - - $resourceTarget->expects($this->once()) - ->method("getAllRelationshipResourceDescriptions") - ->with(true) - ->willReturn($objectDescriptionList); - - $validator = $this->createMockForAbstract(Validator::class, ["getAvailableSortFields"]); - - $rules = $validator->getParameterRules($query); - - $this->assertSame(2, count($rules)); - $this->assertInstanceOf(IncludeRule::class, $rules[0]); - $this->assertInstanceOf(FieldsetRule::class, $rules[1]); - $this->assertSame($whitelist, $rules[0]->getWhitelist()); - $this->assertSame($objectDescriptionList, $rules[1]->getResourceObjectDescriptions()); - $this->assertSame($includes, $rules[1]->getIncludes()); - } -} diff --git a/tests/JsonApi/RequestTest.php b/tests/JsonApi/RequestTest.php deleted file mode 100644 index 7f9918b2..00000000 --- a/tests/JsonApi/RequestTest.php +++ /dev/null @@ -1,104 +0,0 @@ -createMockForAbstract(Validator::class); - $url = new Url("http://www.localhost.com:8080/index.php"); - $request = new JsonApiRequest( - url: $url, - queryValidator: $validator - ); - - $this->assertSame(Method::GET, $request->getMethod()); - $this->assertSame($url, $request->getUrl()); - - $getQueryValidator = $this->makeAccessible($request, "getQueryValidator"); - $this->assertSame($validator, $getQueryValidator->invokeArgs($request, [])); - - $this->assertInstanceOf(HttpRequest::class, $request); - - $request = new JsonApiRequest($url, method: Method::PATCH); - $getQueryValidator = $this->makeAccessible($request, "getQueryValidator"); - $this->assertNull($getQueryValidator->invokeArgs($request, [])); - $this->assertSame(Method::PATCH, $request->getMethod()); - } - - - /** - * tests validate() - */ - public function testValidate() - { - - $query = $this->getMockBuilder(JsonApiQuery::class)->disableOriginalConstructor()->getMock(); - - $url = $this->getMockBuilder(Url::class) - ->disableOriginalConstructor() - ->getMock(); - - $validator = $this->createMockForAbstract(Validator::class, ["validate"]); - - $validator->expects($this->once())->method("validate")->with($query, $this->callback(function ($arg) { - $this->assertInstanceOf( - ValidationErrors::class, - $arg - ); - return true; - })); - - $request = $this->getMockBuilder(JsonApiRequest::class) - ->setConstructorArgs([$url, Method::GET, $validator]) - ->onlyMethods(["getQuery"]) - ->getMock(); - $request->expects($this->once())->method("getQuery")->willReturn($query); - - $request->validate(); - } -} diff --git a/tests/JsonApi/Resource/ResourceListTest.php b/tests/JsonApi/Resource/ResourceListTest.php deleted file mode 100644 index 934276f9..00000000 --- a/tests/JsonApi/Resource/ResourceListTest.php +++ /dev/null @@ -1,99 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - - $this->assertSame(Resource::class, $list->getEntityType()); - } - - - /** - * tests offsetSet(), makes sure no URI duplicates may occur - * @return void - */ - public function testOffsetSet(): void - { - $resource = function (string $uri): MockObject&Resource { - /** - * @var MockObject&Resource $res - */ - $res = $this->createMockForAbstract(Resource::class, ["getUri"]); - $res->expects($this->any())->method("getUri")->willReturn(new Template($uri)); - return $res; - }; - - $resourceList = new ResourceList(); - $resourceList[] = $resource("/uri1"); - $resourceList[] = $resource("/uri2"); - $resourceList[] = $resource("/uri3"); - - try { - $resourceList[] = $resource("/uri2"); - $this->fail(); - } catch (InvalidArgumentException $e) { - $this->assertStringContainsString( - strtolower("a resource for the URI \"/uri2\" already exists"), - strtolower($e->getMessage()) - ); - } - } - - - /** - * @return ResourceList - */ - protected function createList(): ResourceList - { - $list = new ResourceList(); - - - return $list; - } -} diff --git a/tests/JsonApi/Resource/ResourceResolverTest.php b/tests/JsonApi/Resource/ResourceResolverTest.php deleted file mode 100644 index b338f2eb..00000000 --- a/tests/JsonApi/Resource/ResourceResolverTest.php +++ /dev/null @@ -1,162 +0,0 @@ - $this->createResource($uri, $name); - $collection = fn (string $uri, string $name) => $this->createResourceCollection($uri, $name); - - - $resources = [ - "employeeResource" => $resource("/employees/{id}", "Employee"), - "employeeCollection" => $collection("/employees", "Employee"), - "shippingResource" => $resource("/employees/{employeeId}/shippingAddresses/{id}", "ShippingAddress"), - "shippingCollection" => $collection("/employees/{employeeId}/shippingAddresses", "ShippingAddress") - ]; - - $resolver = new ResourceResolver(ResourceList::make(...array_values($resources))); - - $tests = [[ - "input" => "https://localhost:8080/employees/123", - "output" => "employeeResource" - ], [ - "input" => "https://localhost:8080/employees", - "output" => "employeeCollection" - ], [ - "input" => "/employees", - "output" => "employeeCollection" - ], [ - "input" => "https://localhost:8080/employees/123/shippingAddresses", - "output" => "shippingCollection" - ], [ - "input" => "https://localhost:8080/employees/123/shippingAddresses/2", - "output" => "shippingResource" - ]]; - - foreach ($tests as $test) { - ["input" => $input, "output" => $output] = $test; - $this->assertSame( - $resources[$output], - $resolver->resolve(Uri::make($input)) - ); - } - } - - - /** - * tests resolve with Employee Resources - * @return void - */ - public function testResolveWithoutMocks(): void - { - $employeeResource = new EmployeeResource(); - $employeeResourceCollection = new EmployeeResourceCollection(); - - $resources = [ - $employeeResource, - $employeeResourceCollection - ]; - - $resolver = new ResourceResolver(ResourceList::make(...$resources)); - - $this->assertSame( - $employeeResource, - $resolver->resolve(Uri::make("https://localhost:8080/directory/employees/1")) - ); - - $this->assertSame( - $employeeResourceCollection, - $resolver->resolve(Uri::make("https://localhost:8080/directory/employees")) - ); - - $this->assertNull( - $resolver->resolve(Uri::make("https://localhost:8080/directory/shipments")) - ); - } - - - private function createResource(string $uri, string $entityName): MockObject&Resource - { - $mock = $this->getMockBuilder(Resource::class) - ->onlyMethods(["getUri"]) - ->getMock(); - - $mock->expects($this->any())->method("getUri")->willReturn(new Template($uri)); - - return $mock; - } - - - private function createResourceCollection(string $uri, string $entityName): MockObject&ResourceCollection - { - $mock = $this->getMockBuilder(ResourceCollection::class) - ->onlyMethods(["getUri"]) - ->getMock(); - - $mock->expects($this->any())->method("getUri")->willReturn(new Template($uri)); - - - return $mock; - } -} - -class EmployeeResource implements Resource -{ - public function getUri(): Template - { - return new Template("/directory/employees/{id}"); - } -} - -class EmployeeResourceCollection extends EmployeeResource implements ResourceCollection -{ - public function getUri(): Template - { - return new Template("/directory/employees"); - } -} diff --git a/tests/JsonProblem/AbstractProblemTest.php b/tests/JsonProblem/AbstractProblemTest.php deleted file mode 100644 index f5d84eeb..00000000 --- a/tests/JsonProblem/AbstractProblemTest.php +++ /dev/null @@ -1,184 +0,0 @@ -getMockForAbstractClass(AbstractProblem::class); - - $this->assertInstanceOf(Arrayable::class, $problem); - $this->assertInstanceOf(Jsonable::class, $problem); - - $this->assertNull($problem->getStatus()); - $this->assertSame("", $problem->getTitle()); - $this->assertSame("", $problem->getDetail()); - $this->assertSame("about:blank", $problem->getType()); - $this->assertSame("", $problem->getInstance()); - - $problem = $this->getMockForAbstractClass( - AbstractProblem::class, - ["title", "detail", "instance", "type"] - ); - - $this->assertNull($problem->getStatus()); - $this->assertSame("title", $problem->getTitle()); - $this->assertSame("detail", $problem->getDetail()); - $this->assertSame("type", $problem->getType()); - $this->assertSame("instance", $problem->getInstance()); - - $this->assertEquals([ - "title" => "title", - "detail" => "detail", - "type" => "type", - "instance" => "instance" - ], $problem->toArray()); - } - - - /** - * Tests bad method call exception for magic method. - * @noinspection PhpUndefinedMethodInspection - */ - public function testBadMethodCallException() - { - $this->expectException(BadMethodCallException::class); - - $problem = $this->getMockForAbstractClass(AbstractProblem::class); - $problem->foo(); - } - - - /** - * Tests toJson() - * @return void - */ - public function testToJson() - { - $problem = $this->getMockForAbstractClass( - AbstractProblem::class, - ["title", "detail", "instance", "type"] - ); - - $this->assertEquals([ - "title" => "title", - "detail" => "detail", - "type" => "type", - "instance" => "instance" - ], $problem->toJson()); - - $strategy = $this->getMockForAbstractClass(JsonStrategy::class); - - $strategy->expects($this->once())->method("toJson")->with($problem)->willReturn($problem->toArray()); - - $this->assertEquals($problem->toJson($strategy), $problem->toArray()); - } - - - /** - * Tests members and functionality related to additional details. - * - * @return void - */ - public function testAdditionalDetails(): void - { - $args = ["title", "detail", "instance", "type"]; - $problem = $this->getMockForAbstractClass( - AbstractProblem::class, - $args - ); - - $this->assertNull($problem->getAdditionalDetails()); - - $getParameterBag = function () { - $parameterBag = new ParameterBag(); - $parameterBag->parameter = [ - "name" => "pName", - "value" => "pValue" - ]; - return $parameterBag; - }; - - $problem->setAdditionalDetails($getParameterBag()); - $this->assertEquals($getParameterBag(), $problem->getAdditionalDetails()); - $this->assertEqualsCanonicalizing( - array_merge($args, [ - "additionalDetails" => [ - "parameter" => [ - "name" => "pName", - "value" => "pValue" - ] - ] - ]), - $problem->toJson() - ); - - $problem = $this->getMockForAbstractClass(AbstractProblem::class, $args); - $problem->setAdditionalDetails($getParameterBag(), "keys"); - $this->assertEqualsCanonicalizing( - array_merge($args, [ - "keys" => [ - "parameter" => [ - "name" => "pName", - "value" => "pValue" - ] - ] - ]), - $problem->toJson() - ); - - - $problem = $this->getMockForAbstractClass(AbstractProblem::class, $args); - $problem->setAdditionalDetails($getParameterBag(), null); - $this->assertEqualsCanonicalizing( - array_merge($args, [ - "parameter" => [ - "name" => "pName", - "value" => "pValue" - ]]), - $problem->toJson() - ); - } -} diff --git a/tests/JsonProblem/ForbiddenProblemTest.php b/tests/JsonProblem/ForbiddenProblemTest.php deleted file mode 100644 index 31139541..00000000 --- a/tests/JsonProblem/ForbiddenProblemTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertInstanceOf(AbstractProblem::class, $problem); - - $this->assertSame(403, $problem->getStatus()); - $this->assertSame(Status::HTTP_STATUS[Status::HTTP_403], $problem->getTitle()); - } -} diff --git a/tests/JsonProblem/NotFoundProblemTest.php b/tests/JsonProblem/NotFoundProblemTest.php deleted file mode 100644 index 3c79dca0..00000000 --- a/tests/JsonProblem/NotFoundProblemTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertInstanceOf(AbstractProblem::class, $problem); - - $this->assertSame(404, $problem->getStatus()); - $this->assertSame(Status::HTTP_STATUS[Status::HTTP_404], $problem->getTitle()); - } -} diff --git a/tests/JsonProblem/ProblemListTest.php b/tests/JsonProblem/ProblemListTest.php deleted file mode 100644 index dfaab93a..00000000 --- a/tests/JsonProblem/ProblemListTest.php +++ /dev/null @@ -1,97 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - $this->assertSame(AbstractProblem::class, $list->getEntityType()); - } - - - /** - * Tests toArray() and toJson() - */ - public function testToArrayAndJson() - { - $list = $this->createList(); - - $entry1 = $this->createMockForAbstract( - AbstractProblem::class, - ["toArray"] - ); - $entry1->expects($this->once())->method("toArray")->willReturn(["entry1"]); - $entry2 = $this->createMockForAbstract( - AbstractProblem::class, - ["toArray"] - ); - $entry2->expects($this->once())->method("toArray")->willReturn(["entry2"]); - - $list[] = $entry1; - $list[] = $entry2; - - $this->assertEquals([ - ["entry1"], ["entry2"] - ], $list->toArray()); - - $this->runToJsonTest(new ProblemList()); - } - - - /** - * @returnOperandList - */ - protected function createList(): ProblemList - { - return new ProblemList(); - } -} diff --git a/tests/JsonProblem/UnauthorizedProblemTest.php b/tests/JsonProblem/UnauthorizedProblemTest.php deleted file mode 100644 index 0b16ae30..00000000 --- a/tests/JsonProblem/UnauthorizedProblemTest.php +++ /dev/null @@ -1,54 +0,0 @@ -assertInstanceOf(AbstractProblem::class, $problem); - - $this->assertSame(401, $problem->getStatus()); - $this->assertSame(Status::HTTP_STATUS[Status::HTTP_401], $problem->getTitle()); - } -} diff --git a/tests/JsonableTestTrait.php b/tests/JsonableTestTrait.php deleted file mode 100644 index a7d48b53..00000000 --- a/tests/JsonableTestTrait.php +++ /dev/null @@ -1,58 +0,0 @@ -assertInstanceOf(Arrayable::class, $target); - $this->assertInstanceOf(Jsonable::class, $target); - - $this->assertEquals($target->toArray(), $target->toJson()); - - $strategyStub = $this->getMockForAbstractClass(JsonStrategy::class); - - $strategyStub->expects($this->once())->method("toJson")->with($target)->willReturn($target->toArray()); - $this->assertEquals($target->toArray(), $target->toJson($strategyStub)); - } -} diff --git a/tests/MailClient/Message/Attachment/AbstractAttachmentTest.php b/tests/Mail/Client/Attachment/AbstractAttachmentTest.php similarity index 93% rename from tests/MailClient/Message/Attachment/AbstractAttachmentTest.php rename to tests/Mail/Client/Attachment/AbstractAttachmentTest.php index 5f9b5101..8ccb9e1d 100644 --- a/tests/MailClient/Message/Attachment/AbstractAttachmentTest.php +++ b/tests/Mail/Client/Attachment/AbstractAttachmentTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment; +namespace Tests\Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Message\Attachment\AbstractAttachment; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Attachment\AbstractAttachment; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; use InvalidArgumentException; use Tests\TestCase; /** * Class AbstractAttachmentTest - * @package Tests\Conjoon\MailClient\Message\Attachment + * @package Tests\Conjoon\Mail\Client\Attachment */ class AbstractAttachmentTest extends TestCase { diff --git a/tests/MailClient/Message/Attachment/FileAttachmentItemListTest.php b/tests/Mail/Client/Attachment/FileAttachmentItemListTest.php similarity index 88% rename from tests/MailClient/Message/Attachment/FileAttachmentItemListTest.php rename to tests/Mail/Client/Attachment/FileAttachmentItemListTest.php index c5c51f13..92603cad 100644 --- a/tests/MailClient/Message/Attachment/FileAttachmentItemListTest.php +++ b/tests/Mail/Client/Attachment/FileAttachmentItemListTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment; +namespace Tests\Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItem; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItemList; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Jsonable; +use Conjoon\Mail\Client\Attachment\FileAttachmentItem; +use Conjoon\Mail\Client\Attachment\FileAttachmentItemList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; use Tests\TestCase; /** * Class FileAttachmentItemListTest - * @package Tests\Conjoon\MailClient\Message\Attachment + * @package Tests\Conjoon\Mail\Client\Attachment */ class FileAttachmentItemListTest extends TestCase { diff --git a/tests/MailClient/Message/Attachment/FileAttachmentItemTest.php b/tests/Mail/Client/Attachment/FileAttachmentItemTest.php similarity index 92% rename from tests/MailClient/Message/Attachment/FileAttachmentItemTest.php rename to tests/Mail/Client/Attachment/FileAttachmentItemTest.php index 9598242e..4b28822b 100644 --- a/tests/MailClient/Message/Attachment/FileAttachmentItemTest.php +++ b/tests/Mail/Client/Attachment/FileAttachmentItemTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment; +namespace Tests\Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Message\Attachment\AbstractAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItem; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\Contract\Jsonable; +use Conjoon\Mail\Client\Attachment\AbstractAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentItem; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\Jsonable; use InvalidArgumentException; use Tests\TestCase; /** * Class FileAttachmentItemTest - * @package Tests\Conjoon\MailClient\Message\Attachment + * @package Tests\Conjoon\Mail\Client\Attachment */ class FileAttachmentItemTest extends TestCase { @@ -75,7 +75,7 @@ public function testClass() $this->assertEquals( array_merge( - $attachment->getAttachmentKey()->toArray(), + $attachment->getAttachmentKey()->toJson(), ["type" => $type, "text" => $text, "size" => $size, diff --git a/tests/MailClient/Message/Attachment/FileAttachmentListTest.php b/tests/Mail/Client/Attachment/FileAttachmentListTest.php similarity index 88% rename from tests/MailClient/Message/Attachment/FileAttachmentListTest.php rename to tests/Mail/Client/Attachment/FileAttachmentListTest.php index 10029b8e..2f7e1c80 100644 --- a/tests/MailClient/Message/Attachment/FileAttachmentListTest.php +++ b/tests/Mail/Client/Attachment/FileAttachmentListTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment; +namespace Tests\Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Jsonable; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; use Tests\TestCase; /** * Class FileAttachmentListTest - * @package Tests\Conjoon\MailClient\Message\Attachment + * @package Tests\Conjoon\Mail\Client\Attachment */ class FileAttachmentListTest extends TestCase { diff --git a/tests/MailClient/Message/Attachment/FileAttachmentTest.php b/tests/Mail/Client/Attachment/FileAttachmentTest.php similarity index 94% rename from tests/MailClient/Message/Attachment/FileAttachmentTest.php rename to tests/Mail/Client/Attachment/FileAttachmentTest.php index 2cdc3142..65d5ed0f 100644 --- a/tests/MailClient/Message/Attachment/FileAttachmentTest.php +++ b/tests/Mail/Client/Attachment/FileAttachmentTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment; +namespace Tests\Conjoon\Mail\Client\Attachment; -use Conjoon\MailClient\Message\Attachment\AbstractAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\Core\Util\ArrayUtil; +use Conjoon\Mail\Client\Attachment\AbstractAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Util\ArrayUtil; use InvalidArgumentException; use Tests\TestCase; /** * Class FileAttachmentTest - * @package Tests\Conjoon\MailClient\Message\Attachment + * @package Tests\Conjoon\Mail\Client\Attachment */ class FileAttachmentTest extends TestCase { diff --git a/tests/MailClient/Message/Attachment/Processor/InlineDataProcessorTest.php b/tests/Mail/Client/Attachment/Processor/InlineDataProcessorTest.php similarity index 88% rename from tests/MailClient/Message/Attachment/Processor/InlineDataProcessorTest.php rename to tests/Mail/Client/Attachment/Processor/InlineDataProcessorTest.php index 6db00c28..537cd183 100644 --- a/tests/MailClient/Message/Attachment/Processor/InlineDataProcessorTest.php +++ b/tests/Mail/Client/Attachment/Processor/InlineDataProcessorTest.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment\Processor; +namespace Tests\Conjoon\Mail\Client\Attachment\Processor; -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\Processor\FileAttachmentProcessor; -use Conjoon\MailClient\Message\Attachment\Processor\InlineDataProcessor; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\Processor\FileAttachmentProcessor; +use Conjoon\Mail\Client\Attachment\Processor\InlineDataProcessor; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; use Tests\TestCase; /** * Class InlineDataProcessorTest - * @package Tests\Conjoon\MailClient\Message\Attachment\Processor + * @package Tests\Conjoon\Mail\Client\Attachment\Processor */ class InlineDataProcessorTest extends TestCase { diff --git a/tests/MailClient/Message/Attachment/Processor/ProcessorExceptionTest.php b/tests/Mail/Client/Attachment/Processor/ProcessorExceptionTest.php similarity index 85% rename from tests/MailClient/Message/Attachment/Processor/ProcessorExceptionTest.php rename to tests/Mail/Client/Attachment/Processor/ProcessorExceptionTest.php index adc9e6d1..d32ada54 100644 --- a/tests/MailClient/Message/Attachment/Processor/ProcessorExceptionTest.php +++ b/tests/Mail/Client/Attachment/Processor/ProcessorExceptionTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Attachment\Processor; +namespace Tests\Conjoon\Mail\Client\Attachment\Processor; -use Conjoon\MailClient\Message\Attachment\Processor\ProcessorException; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\Attachment\Processor\ProcessorException; +use Conjoon\Mail\Client\MailClientException; use Tests\TestCase; /** * Class ProcessorExceptionTest - * @package Tests\Conjoon\MailClient\Message\Attachment\Processor + * @package Tests\Conjoon\Mail\Client\Attachment\Processor */ class ProcessorExceptionTest extends TestCase { diff --git a/tests/MailClient/Data/CompoundKey/AttachmentKeyTest.php b/tests/Mail/Client/Data/CompoundKey/AttachmentKeyTest.php similarity index 88% rename from tests/MailClient/Data/CompoundKey/AttachmentKeyTest.php rename to tests/Mail/Client/Data/CompoundKey/AttachmentKeyTest.php index d21e2e3a..e1ccacac 100644 --- a/tests/MailClient/Data/CompoundKey/AttachmentKeyTest.php +++ b/tests/Mail/Client/Data/CompoundKey/AttachmentKeyTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\CompoundKey; +namespace Tests\Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\Data\CompoundKey\MessageItemChildCompoundKey; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageItemChildCompoundKey; use Tests\TestCase; /** * Class AttachmentKeyTest - * @package Tests\Conjoon\MailClient\Data\CompoundKey + * @package Tests\Conjoon\Mail\Client\Data\CompoundKey */ class AttachmentKeyTest extends TestCase { @@ -56,7 +56,7 @@ public function testClass() $this->assertInstanceOf(MessageItemChildCompoundKey::class, $key); - $this->assertSame(json_encode($key->toArray()), $key->toString()); + $this->assertSame(json_encode($key->toJson()), $key->toString()); } diff --git a/tests/MailClient/Data/CompoundKey/FolderKeyTest.php b/tests/Mail/Client/Data/CompoundKey/FolderKeyTest.php similarity index 83% rename from tests/MailClient/Data/CompoundKey/FolderKeyTest.php rename to tests/Mail/Client/Data/CompoundKey/FolderKeyTest.php index 1bdc9ab3..dc65037c 100644 --- a/tests/MailClient/Data/CompoundKey/FolderKeyTest.php +++ b/tests/Mail/Client/Data/CompoundKey/FolderKeyTest.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\CompoundKey; +namespace Tests\Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\Core\Contract\Stringable; +use Conjoon\Mail\Client\Data\CompoundKey\CompoundKey; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Util\Stringable; use Tests\TestCase; /** * Class FolderKeyTest - * @package Tests\Conjoon\MailClient\Data\CompoundKey + * @package Tests\Conjoon\Mail\Client\Data\CompoundKey */ class FolderKeyTest extends TestCase { @@ -59,9 +59,9 @@ public function testClass() $this->assertSame($mailAccountId, $key->getMailAccountId()); $this->assertSame($id, $key->getId()); - $this->assertEquals(["mailAccountId" => $mailAccountId, "id" => $id], $key->toArray()); + $this->assertEquals(["mailAccountId" => $mailAccountId, "id" => $id], $key->toJson()); - $this->assertSame(json_encode($key->toArray()), $key->toString()); + $this->assertSame(json_encode($key->toJson()), $key->toString()); $mailAccount = new MailAccount(["id" => "dev"]); $key = new FolderKey($mailAccount, $id); diff --git a/tests/MailClient/Data/CompoundKey/MessageItemChildCompoundKeyTest.php b/tests/Mail/Client/Data/CompoundKey/MessageItemChildCompoundKeyTest.php similarity index 94% rename from tests/MailClient/Data/CompoundKey/MessageItemChildCompoundKeyTest.php rename to tests/Mail/Client/Data/CompoundKey/MessageItemChildCompoundKeyTest.php index 5b850086..8cbea601 100644 --- a/tests/MailClient/Data/CompoundKey/MessageItemChildCompoundKeyTest.php +++ b/tests/Mail/Client/Data/CompoundKey/MessageItemChildCompoundKeyTest.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\CompoundKey; +namespace Tests\Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\MessageItemChildCompoundKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageItemChildCompoundKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; use Tests\TestCase; use InvalidArgumentException; /** * Class MessageItemChildCompoundKeyTest - * @package Tests\Conjoon\MailClient\Data\CompoundKey + * @package Tests\Conjoon\Mail\Client\Data\CompoundKey */ class MessageItemChildCompoundKeyTest extends TestCase { @@ -66,9 +66,9 @@ public function testClass() "mailFolderId" => $mailFolderId, "parentMessageItemId" => $parentMessageItemId, "id" => $id - ], $key->toArray()); + ], $key->toJson()); - $this->assertSame(json_encode($key->toArray()), $key->toString()); + $this->assertSame(json_encode($key->toJson()), $key->toString()); // w/ MessageKey $mailAccountId = "dev1"; @@ -95,7 +95,7 @@ public function testClass() "mailFolderId" => $mailFolderId, "parentMessageItemId" => $parentMessageItemId, "id" => $id - ], $key->toArray()); + ], $key->toJson()); } diff --git a/tests/MailClient/Data/CompoundKey/MessageKeyTest.php b/tests/Mail/Client/Data/CompoundKey/MessageKeyTest.php similarity index 89% rename from tests/MailClient/Data/CompoundKey/MessageKeyTest.php rename to tests/Mail/Client/Data/CompoundKey/MessageKeyTest.php index b3af2367..a8258402 100644 --- a/tests/MailClient/Data/CompoundKey/MessageKeyTest.php +++ b/tests/Mail/Client/Data/CompoundKey/MessageKeyTest.php @@ -27,19 +27,19 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\CompoundKey; +namespace Tests\Conjoon\Mail\Client\Data\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\CompoundKey; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\Core\Contract\Stringable; +use Conjoon\Mail\Client\Data\CompoundKey\CompoundKey; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Util\Stringable; use InvalidArgumentException; use Tests\TestCase; /** * Class MessageKeyTest - * @package Tests\Conjoon\MailClient\Data\CompoundKey + * @package Tests\Conjoon\Mail\Client\Data\CompoundKey */ class MessageKeyTest extends TestCase { @@ -65,9 +65,9 @@ public function testClass() "mailAccountId" => $mailAccountId, "mailFolderId" => $mailFolderId, "id" => $id - ], $key->toArray()); + ], $key->toJson()); - $this->assertSame(json_encode($key->toArray()), $key->toString()); + $this->assertSame(json_encode($key->toJson()), $key->toString()); $mailAccount = new MailAccount(["id" => "dev"]); $key = new MessageKey($mailAccount, $mailFolderId, $id); diff --git a/tests/MailClient/Data/DataExceptionTest.php b/tests/Mail/Client/Data/DataExceptionTest.php similarity index 89% rename from tests/MailClient/Data/DataExceptionTest.php rename to tests/Mail/Client/Data/DataExceptionTest.php index 520c5278..84d48a3d 100644 --- a/tests/MailClient/Data/DataExceptionTest.php +++ b/tests/Mail/Client/Data/DataExceptionTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data; +namespace Tests\Conjoon\Mail\Client\Data; -use Conjoon\MailClient\Data\DataException; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\Data\DataException; +use Conjoon\Mail\Client\MailClientException; use Tests\TestCase; /** * Class DataExceptionTest - * @package Tests\Conjoon\MailClient\Data + * @package Tests\Conjoon\Mail\Client\Data */ class DataExceptionTest extends TestCase { diff --git a/tests/MailClient/Data/MailAccountTest.php b/tests/Mail/Client/Data/MailAccountTest.php similarity index 93% rename from tests/MailClient/Data/MailAccountTest.php rename to tests/Mail/Client/Data/MailAccountTest.php index cac42e4b..6a6bb5ce 100644 --- a/tests/MailClient/Data/MailAccountTest.php +++ b/tests/Mail/Client/Data/MailAccountTest.php @@ -27,19 +27,19 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data; +namespace Tests\Conjoon\Mail\Client\Data; use BadMethodCallException; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Data\Protocol\Http\Response\JsonApiStrategy; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Util\JsonApiStrategy; +use Conjoon\Util\Arrayable; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonStrategy; use Tests\TestCase; /** * Class MailAccountTest - * @package Tests\Conjoon\MailClient\Data + * @package Tests\Conjoon\Mail\Client\Data */ class MailAccountTest extends TestCase { @@ -159,5 +159,11 @@ public function testToJson() ->willReturn($account->toArray()); $this->assertEquals($config, $account->toJson($strategyMock)); + + + } + + + } diff --git a/tests/MailClient/Data/MailAddressListTest.php b/tests/Mail/Client/Data/MailAddressListTest.php similarity index 72% rename from tests/MailClient/Data/MailAddressListTest.php rename to tests/Mail/Client/Data/MailAddressListTest.php index 87fd3db8..23872f9f 100644 --- a/tests/MailClient/Data/MailAddressListTest.php +++ b/tests/Mail/Client/Data/MailAddressListTest.php @@ -27,27 +27,23 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data; - -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Copyable; -use Conjoon\Core\Contract\JsonDecodable; -use Conjoon\Core\Exception\JsonDecodeException; -use Tests\JsonableTestTrait; -use Tests\StringableTestTrait; +namespace Tests\Conjoon\Mail\Client\Data; + +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Copyable; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodable; +use Conjoon\Util\JsonDecodeException; use Tests\TestCase; /** * Class MailAddressListTest - * @package Tests\Conjoon\MailClient\Data + * @package Tests\Conjoon\Mail\Client\Data */ class MailAddressListTest extends TestCase { - use JsonableTestTrait; - use StringableTestTrait; - // --------------------- // Tests // --------------------- @@ -60,6 +56,7 @@ public function testClass() $mailAddressList = new MailAddressList(); $this->assertInstanceOf(AbstractList::class, $mailAddressList); + $this->assertInstanceOf(Jsonable::class, $mailAddressList); $this->assertInstanceOf(JsonDecodable::class, $mailAddressList); $this->assertInstanceOf(Copyable::class, $mailAddressList); @@ -72,14 +69,17 @@ public function testClass() /** * Tests toArray */ - public function testToArray() + public function testToJson() { - $mailAddressList = $this->createList(); + + $mailAddressList = new MailAddressList(); + $mailAddressList[] = new MailAddress("name1@address.testcomdomaindev", "name1"); + $mailAddressList[] = new MailAddress("name2@address.testcomdomaindev", "name2"); $this->assertEquals([ - $mailAddressList[0]->toArray(), - $mailAddressList[1]->toArray() - ], $mailAddressList->toArray()); + $mailAddressList[0]->toJson(), + $mailAddressList[1]->toJson() + ], $mailAddressList->toJson()); } @@ -88,9 +88,12 @@ public function testToArray() */ public function testFromString() { - $mailAddressList = $this->createList(); - $jsonString = json_encode($mailAddressList->toArray()); + $mailAddressList = new MailAddressList(); + $mailAddressList[] = new MailAddress("name1@address.testcomdomaindev", "name1"); + $mailAddressList[] = new MailAddress("name2@address.testcomdomaindev", "name2"); + + $jsonString = json_encode($mailAddressList->toJson()); $this->assertEquals($mailAddressList, MailAddressList::fromString($jsonString)); $jsonString = "[{\"name\" : \"foo\"}]"; @@ -125,14 +128,15 @@ public function testFromStringWithExceptionInvalid() */ public function testToString() { - $mailAddressList = $this->createList(); + + $mailAddressList = new MailAddressList(); + $mailAddressList[] = new MailAddress("name1@address.testcomdomaindev", "name1"); + $mailAddressList[] = new MailAddress("name2@address.testcomdomaindev", "name2"); $this->assertSame( $mailAddressList[0]->toString() . ", " . $mailAddressList[1]->toString(), $mailAddressList->toString() ); - - $this->runToStringTest(MailAddressList::class); } /** @@ -140,36 +144,13 @@ public function testToString() */ public function testCopy() { - $mailAddressList = $this->createList(); - - $copy = $mailAddressList->copy(); - $this->assertEquals($copy, $mailAddressList); - $this->assertNotSame($copy, $mailAddressList); - } - - - /** - * tests toJson - */ - public function testToJson() - { - $mailAddressList = $this->createList(); - $this->runToJsonTest($mailAddressList); - } - -// +---------------------------------------- -// | Helper -// +---------------------------------------- - /** - * @return MailAddressList - */ - protected function createList() - { $mailAddressList = new MailAddressList(); $mailAddressList[] = new MailAddress("name1@address.testcomdomaindev", "name1"); $mailAddressList[] = new MailAddress("name2@address.testcomdomaindev", "name2"); - return $mailAddressList; + $copy = $mailAddressList->copy(); + $this->assertEquals($copy, $mailAddressList); + $this->assertNotSame($copy, $mailAddressList); } } diff --git a/tests/MailClient/Data/MailAddressTest.php b/tests/Mail/Client/Data/MailAddressTest.php similarity index 84% rename from tests/MailClient/Data/MailAddressTest.php rename to tests/Mail/Client/Data/MailAddressTest.php index 1cb0080c..dea2c6ff 100644 --- a/tests/MailClient/Data/MailAddressTest.php +++ b/tests/Mail/Client/Data/MailAddressTest.php @@ -27,28 +27,23 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data; - -use Conjoon\Core\Contract\Arrayable; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\Core\Contract\Copyable; -use Conjoon\Core\Contract\JsonDecodable; -use Conjoon\Core\Exception\JsonDecodeException; -use Conjoon\Core\Contract\Stringable; +namespace Tests\Conjoon\Mail\Client\Data; + +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Util\Copyable; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodable; +use Conjoon\Util\JsonDecodeException; +use Conjoon\Util\Stringable; use InvalidArgumentException; -use Tests\StringableTestTrait; use Tests\TestCase; -use Tests\JsonableTestTrait; /** * Class MailAddressTest - * @package Tests\Conjoon\MailClient\Data + * @package Tests\Conjoon\Mail\Client\Data */ class MailAddressTest extends TestCase { - use JsonableTestTrait; - use StringableTestTrait; - // --------------------- // Tests // --------------------- @@ -63,13 +58,14 @@ public function testClass() $address = "peter.parker@newyork.com"; $mailAddress = new MailAddress($address, $name); + $this->assertInstanceOf(Jsonable::class, $mailAddress); $this->assertInstanceOf(Stringable::class, $mailAddress); $this->assertInstanceOf(JsonDecodable::class, $mailAddress); $this->assertInstanceOf(Copyable::class, $mailAddress); $this->assertSame($address, $mailAddress->getAddress()); $this->assertSame($name, $mailAddress->getName()); - $this->assertEquals(["name" => $name, "address" => $address], $mailAddress->toArray()); + $this->assertEquals(["name" => $name, "address" => $address], $mailAddress->toJson()); } @@ -107,8 +103,6 @@ public function testToString() $mailAddress = new MailAddress($address, $name); $this->assertSame("Peter Parker ", $mailAddress->toString()); - - $this->runToStringTest(MailAddress::class); } /** @@ -121,7 +115,7 @@ public function testFromString() $address = "peter.parker@newyork.com"; $mailAddress = new MailAddress($address, $name); - $jsonString = json_encode($mailAddress->toArray()); + $jsonString = json_encode($mailAddress->toJson()); $this->assertEquals($mailAddress, MailAddress::fromString($jsonString)); $jsonString = json_encode(["address" => "foo"]); @@ -170,18 +164,4 @@ public function testCopy() $this->assertSame($address1->getName(), $mailAddress->getName()); $this->assertNotSame($address1, $mailAddress); } - - - /** - * tests toJson() - */ - public function testToJson() - { - $mailAddress = new MailAddress( - "peter.parker@newyork.com", - "Peter Parker" - ); - - $this->runToJsonTest($mailAddress); - } } diff --git a/tests/MailClient/Folder/AbstractMailFolderTest.php b/tests/Mail/Client/Folder/AbstractMailFolderTest.php similarity index 64% rename from tests/MailClient/Folder/AbstractMailFolderTest.php rename to tests/Mail/Client/Folder/AbstractMailFolderTest.php index b8fa6931..c251ddc9 100644 --- a/tests/MailClient/Folder/AbstractMailFolderTest.php +++ b/tests/Mail/Client/Folder/AbstractMailFolderTest.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Folder; +namespace Tests\Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Folder\AbstractMailFolder; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Folder\AbstractMailFolder; use InvalidArgumentException; use Tests\TestCase; /** * Class AbstractMailFolderTest - * @package Tests\Conjoon\MailClient\Folder + * @package Tests\Conjoon\Mail\Client\Folder */ class AbstractMailFolderTest extends TestCase { @@ -51,15 +51,13 @@ public function testConstructor() { $name = "INBOX.Some Folder"; - $unreadMessages = 23; - $totalMessages = 100; + $unreadCount = 23; $folderKey = new FolderKey("dev", $name); $abstractMailFolder = $this->createMailFolder( $folderKey, [ - "unreadMessages" => $unreadMessages, - "totalMessages" => $totalMessages, + "unreadCount" => $unreadCount, "name" => $name ] ); @@ -68,62 +66,46 @@ public function testConstructor() $this->assertSame($folderKey, $abstractMailFolder->getFolderKey()); $this->assertSame($name, $abstractMailFolder->getName()); - $this->assertSame($unreadMessages, $abstractMailFolder->getUnreadMessages()); - $this->assertSame($totalMessages, $abstractMailFolder->getTotalMessages()); + $this->assertSame($unreadCount, $abstractMailFolder->getUnreadCount()); } /** - * Tests constructor with exception for missing unreadMessages never thrown + * Tests constructor with exception for missing unreadCount */ - public function testConstructorExceptionUnreadCountNotThrown() + public function testConstructorExceptionUnreadCount() { + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("unreadCount"); + $folderKey = new FolderKey("dev", "TEST"); - $folder = $this->createMailFolder( + $this->createMailFolder( $folderKey, [ "name" => "TEST" ] ); - - $this->assertNull($folder->getUnreadMessages()); - $this->assertNull($folder->getTotalMessages()); } /** - * Tests constructor with exception for missing name neevr thrown + * Tests constructor with exception for missing name */ - public function testConstructorExceptionNameNotThrown() + public function testConstructorExceptionName() { - $folderKey = new FolderKey("dev", "TEST"); - $folder = $this->createMailFolder( - $folderKey, - [ - "unreadMessages" => 0, - "totalMessages" => 0 - ] - ); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("name"); - $this->assertNull($folder->getName()); - } - /** - * Tests constructor with exception for missing totalMessages never thrown - */ - public function testConstructorExceptionTotalMessagesNotThrown() - { $folderKey = new FolderKey("dev", "TEST"); - $folder = $this->createMailFolder( + $this->createMailFolder( $folderKey, [ - "unreadMessages" => 0, - "name" => "INBOX" + "unreadCount" => 0 ] ); - - $this->assertNull($folder->getTotalMessages()); } diff --git a/tests/MailClient/Folder/ListMailFolderTest.php b/tests/Mail/Client/Folder/ListMailFolderTest.php similarity index 87% rename from tests/MailClient/Folder/ListMailFolderTest.php rename to tests/Mail/Client/Folder/ListMailFolderTest.php index a6570c13..c616a270 100644 --- a/tests/MailClient/Folder/ListMailFolderTest.php +++ b/tests/Mail/Client/Folder/ListMailFolderTest.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Folder; +namespace Tests\Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Folder\AbstractMailFolder; -use Conjoon\MailClient\Folder\ListMailFolder; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Folder\AbstractMailFolder; +use Conjoon\Mail\Client\Folder\ListMailFolder; use InvalidArgumentException; use Tests\TestCase; /** * Class ListMailFolderTest - * @package Tests\Conjoon\MailClient\Folder + * @package Tests\Conjoon\Mail\Client\Folder */ class ListMailFolderTest extends TestCase { @@ -60,8 +60,7 @@ public function testConstructor() [ "delimiter" => $delimiter, "name" => $name, - "unreadMessages" => 0, - "totalMessages" => 10 + "unreadCount" => 0 ] ); @@ -76,8 +75,7 @@ public function testConstructor() [ "delimiter" => $delimiter, "name" => $name, - "unreadMessages" => 0, - "totalMessages" => 0, + "unreadCount" => 0, "attributes" => $attributes ] ); @@ -105,8 +103,7 @@ public function testConstructorExceptionDelimiter() $folderKey, [ "name" => $name, - "unreadMessages" => 0, - "totalMessages" => 100 + "unreadCount" => 0 ] ); } diff --git a/tests/MailClient/Folder/MailFolderChildListTest.php b/tests/Mail/Client/Folder/MailFolderChildListTest.php similarity index 58% rename from tests/MailClient/Folder/MailFolderChildListTest.php rename to tests/Mail/Client/Folder/MailFolderChildListTest.php index eaf4f051..23d083b8 100644 --- a/tests/MailClient/Folder/MailFolderChildListTest.php +++ b/tests/Mail/Client/Folder/MailFolderChildListTest.php @@ -27,20 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Folder; +namespace Tests\Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Folder\MailFolder; -use Conjoon\MailClient\Folder\MailFolderChildList; -use Conjoon\Core\AbstractList; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Folder\MailFolder; +use Conjoon\Mail\Client\Folder\MailFolderChildList; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; use Tests\TestCase; /** * Class MailFolderChildListTest - * @package Tests\Conjoon\MailClient\Folder + * @package Tests\Conjoon\Mail\Client\Folder */ class MailFolderChildListTest extends TestCase { @@ -56,7 +54,6 @@ public function testClass() $mailFolderChildList = new MailFolderChildList(); $this->assertInstanceOf(AbstractList::class, $mailFolderChildList); - $this->assertInstanceOf(Arrayable::class, $mailFolderChildList); $this->assertInstanceOf(Jsonable::class, $mailFolderChildList); $this->assertSame(MailFolder::class, $mailFolderChildList->getEntityType()); @@ -66,13 +63,12 @@ public function testClass() /** * Tests constructor */ - public function testToArray() + public function testToJson() { $data = [ "name" => "INBOX", - "unreadMessages" => 5, - "totalMessages" => 10, + "unreadCount" => 5, "folderType" => MailFolder::TYPE_INBOX ]; @@ -86,55 +82,12 @@ public function testToArray() $mailFolderChildList[] = $folder; $this->assertEquals([[ - "type" => "MailFolder", "mailAccountId" => "dev", "id" => "INBOX", "folderType" => MailFolder::TYPE_INBOX, - "unreadMessages" => 5, - "totalMessages" => 10, + "unreadCount" => 5, "name" => "INBOX", "data" => [] - ]], $mailFolderChildList->toArray()); - } - - - /** - * Tests constructor - */ - public function testToJson() - { - - $data = [ - "name" => "INBOX", - "unreadMessages" => 5, - "totalMessages" => 10, - "folderType" => MailFolder::TYPE_INBOX - ]; - - $folder = new MailFolder( - new FolderKey("dev", "INBOX"), - $data - ); - - $mailFolderChildList = new MailFolderChildList(); - $mailFolderChildList[] = $folder; - - $this->assertEquals( - $mailFolderChildList->toArray(), - $mailFolderChildList->toJson() - ); - - // w/ strategy - $strategyMock = - $this->getMockBuilder(JsonStrategy::class) - ->getMockForAbstractClass(); - - $strategyMock - ->expects($this->exactly(1)) - ->method("toJson") - ->with($mailFolderChildList) - ->willReturn($mailFolderChildList->toArray()); - - $this->assertEquals($mailFolderChildList->toArray(), $mailFolderChildList->toJson($strategyMock)); + ]], $mailFolderChildList->toJson()); } } diff --git a/tests/MailClient/Folder/MailFolderListTest.php b/tests/Mail/Client/Folder/MailFolderListTest.php similarity index 88% rename from tests/MailClient/Folder/MailFolderListTest.php rename to tests/Mail/Client/Folder/MailFolderListTest.php index c0ba7236..b62ff8ee 100644 --- a/tests/MailClient/Folder/MailFolderListTest.php +++ b/tests/Mail/Client/Folder/MailFolderListTest.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Folder; +namespace Tests\Conjoon\Mail\Client\Folder; -use Conjoon\MailClient\Folder\ListMailFolder; -use Conjoon\MailClient\Folder\MailFolderList; -use Conjoon\Core\AbstractList; +use Conjoon\Mail\Client\Folder\ListMailFolder; +use Conjoon\Mail\Client\Folder\MailFolderList; +use Conjoon\Util\AbstractList; use Tests\TestCase; /** * Class MailFolderListTest - * @package Tests\Conjoon\MailClient\Folder + * @package Tests\Conjoon\Mail\Client\Folder */ class MailFolderListTest extends TestCase { diff --git a/tests/Mail/Client/Folder/MailFolderTest.php b/tests/Mail/Client/Folder/MailFolderTest.php new file mode 100644 index 00000000..91cad63b --- /dev/null +++ b/tests/Mail/Client/Folder/MailFolderTest.php @@ -0,0 +1,181 @@ +createKey(); + + $this->assertTrue(MailFolder::TYPE_INBOX != ""); + $this->assertTrue(MailFolder::TYPE_DRAFT != ""); + $this->assertTrue(MailFolder::TYPE_JUNK != ""); + $this->assertTrue(MailFolder::TYPE_TRASH != ""); + $this->assertTrue(MailFolder::TYPE_SENT != ""); + $this->assertTrue(MailFolder::TYPE_FOLDER != ""); + + $mailFolder = new MailFolder( + $folderKey, + [ + "name" => "Folder", + "unreadCount" => 0, + "folderType" => MailFolder::TYPE_INBOX + ] + ); + + $this->assertInstanceOf(AbstractMailFolder::class, $mailFolder); + $this->assertSame(MailFolder::TYPE_INBOX, $mailFolder->getFolderType()); + + + $children = $mailFolder->getData(); + $this->assertInstanceOf(MailFolderChildList::class, $mailFolder->getData()); + $this->assertSame(0, count($children)); + + + $mf = new MailFolder($this->createKey(), [ + "name" => "Folder2", + "unreadCount" => 32, + "folderType" => MailFolder::TYPE_INBOX + ]); + $mailFolder->addMailFolder($mf); + + $this->assertSame(1, count($children)); + $this->assertSame($mf, $children[0]); + } + + + /** + * Tests constructor with exception for missing folderType + */ + public function testConstructorExceptionFolderType() + { + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage("folderType"); + + $folderKey = $this->createKey(); + new MailFolder( + $folderKey, + [ + ] + ); + } + + + /** + * Test for exception if invalid folder type gets submitted to setFolderType + */ + public function testSetFolderTypeException() + { + $this->expectException(InvalidArgumentException::class); + + new MailFolder($this->createKey(), ["folderType" => "foo"]); + } + + + /** + * Test for toJson + */ + public function testToJson() + { + + $data = [ + "folderType" => MailFolder::TYPE_INBOX, + "name" => "INBOX", + "unreadCount" => 5 + ]; + + $key = $this->createKey("dev", "INBOX"); + + $mf = new MailFolder($key, $data); + + $mf->addMailFolder( + new MailFolder( + $this->createKey("dev", "INBOX.SubFolder"), + [ + "name" => "A", + "unreadCount" => 4, + "folderType" => MailFolder::TYPE_INBOX + ] + ) + ); + + $json = $mf->toJson(); + + $expected = array_merge($key->toJson(), $data); + $expected["data"] = [[ + "mailAccountId" => "dev", + "id" => "INBOX.SubFolder", + "name" => "A", + "unreadCount" => 4, + "folderType" => MailFolder::TYPE_INBOX, + "data" => [] + ]]; + + + $this->assertEquals($expected, $json); + } + + + +// --------------------- +// Helper +// --------------------- + + + /** + * @return FolderKey + */ + public function createKey($account = "dev", $name = "INBOX.Some Folder") + { + + return new FolderKey($account, $name); + } +} diff --git a/tests/MailClient/Folder/Tree/DefaultMailFolderTreeBuilderTest.php b/tests/Mail/Client/Folder/Tree/DefaultMailFolderTreeBuilderTest.php similarity index 70% rename from tests/MailClient/Folder/Tree/DefaultMailFolderTreeBuilderTest.php rename to tests/Mail/Client/Folder/Tree/DefaultMailFolderTreeBuilderTest.php index 0006ce91..8cc99309 100644 --- a/tests/MailClient/Folder/Tree/DefaultMailFolderTreeBuilderTest.php +++ b/tests/Mail/Client/Folder/Tree/DefaultMailFolderTreeBuilderTest.php @@ -27,23 +27,20 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Folder\Tree; - -use Conjoon\Data\ParameterBag; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\Resource\MailFolder as MailFolderResource; -use Conjoon\MailClient\Folder\ListMailFolder; -use Conjoon\MailClient\Folder\MailFolder; -use Conjoon\MailClient\Folder\MailFolderList; -use Conjoon\MailClient\Folder\Tree\DefaultMailFolderTreeBuilder; -use Conjoon\MailClient\Folder\Tree\MailFolderTreeBuilder; -use Conjoon\MailClient\Data\Protocol\Imap\Util\DefaultFolderIdToTypeMapper; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; +namespace Tests\Conjoon\Mail\Client\Folder\Tree; + +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Folder\ListMailFolder; +use Conjoon\Mail\Client\Folder\MailFolder; +use Conjoon\Mail\Client\Folder\MailFolderList; +use Conjoon\Mail\Client\Folder\Tree\DefaultMailFolderTreeBuilder; +use Conjoon\Mail\Client\Folder\Tree\MailFolderTreeBuilder; +use Conjoon\Mail\Client\Imap\Util\DefaultFolderIdToTypeMapper; use Tests\TestCase; /** * Class DefaultMailFolderTreeBuilderTest - * @package Tests\Conjoon\MailClient\Folder\Tree + * @package Tests\Conjoon\Mail\Client\Folder\Tree */ class DefaultMailFolderTreeBuilderTest extends TestCase { @@ -79,7 +76,7 @@ public function testListToTreeInbox() "STUFF.Folder"] ); - $mailFolderChildList = $builder->listToTree($mailFolderList, ["INBOX"], $this->getResourceQuery()); + $mailFolderChildList = $builder->listToTree($mailFolderList, ["INBOX"]); $this->assertSame(3, count($mailFolderChildList)); @@ -148,7 +145,7 @@ public function testListToTreeStuff() "STUFF.Folder"] ); - $mailFolderChildList = $builder->listToTree($mailFolderList, ["STUFF"], $this->getResourceQuery()); + $mailFolderChildList = $builder->listToTree($mailFolderList, ["STUFF"]); $this->assertSame(2, count($mailFolderChildList)); @@ -188,7 +185,7 @@ public function testSortMailFolders() ] ); - $mailFolderChildList = $builder->listToTree($mailFolderList, [], $this->getResourceQuery()); + $mailFolderChildList = $builder->listToTree($mailFolderList, []); $this->assertSame(5, count($mailFolderChildList)); @@ -204,76 +201,6 @@ public function testSortMailFolders() $this->assertSame("STUFF", $mailFolder->getName()); } - - /** - * Tests sortMailFolders - */ - public function testSparseFieldsets() - { - $testFn = function ($count, $mailFolderChildList) { - $this->assertSame($count, count($mailFolderChildList)); - foreach ($mailFolderChildList as $mailFolder) { - $this->assertNull($mailFolder->getData()); - $this->assertNotNull($mailFolder->getName()); - $this->assertNull($mailFolder->getUnreadMessages()); - $this->assertNull($mailFolder->getFolderType()); - $this->assertNotNull($mailFolder->getTotalMessages()); - } - }; - - $builder = $this->createBuilder(); - - $tests = [ - [ - "input" => [ - "root" => ["MYBOX.Sent"], - "folders" => [ - "Junk", - "INBOX", - "Drafts", - "MYBOX.Sent", - "MYBOX.Sent.Folder", - "STUFF", - "TRASH", - "STUFF.Folder" - ] - ], - "expected" => 1 - ], - [ - "input" => [ - "root" => [], - "folders" => [ - "Junk", - "INBOX", - "Drafts", - "STUFF", - "TRASH", - "STUFF.Folder" - ] - ], - "expected" => 5 - ] - ]; - - foreach ($tests as $test) { - $mailFolderList = $this->createMailFolderList( - $test["input"]["folders"] - ); - - $query = - - $mailFolderChildList = $builder->listToTree($mailFolderList, $test["input"]["root"], $this->getResourceQuery( - ["name", "totalMessages"] - )); - - $testFn($test["expected"], $mailFolderChildList); - } - } - - - - // ------------------------------- // Helper // ------------------------------- @@ -301,8 +228,7 @@ protected function createMailFolderList($data): MailFolderList $listMailFolder = new ListMailFolder( new FolderKey("dev", $item), array_merge(["name" => array_pop($parts), - "unreadMessages" => 0, - "totalMessages" => 0, + "unreadCount" => 0, "delimiter" => $delimiter], $cData) ); @@ -338,7 +264,7 @@ public function createListMailFolder(string $id, string $delimiter): ListMailFol new FolderKey("dev", $id), ["name" => array_pop($parts), "delimiter" => $delimiter, - "unreadMessages" => 0] + "unreadCount" => 0] ); } @@ -361,28 +287,4 @@ protected function createFolderKey($mid, $id): FolderKey { return new FolderKey($mid, $id); } - - - /** - * @param array $parameters - * @return MailFolderListQuery - */ - protected function getResourceQuery(array $fields = null): MailFolderListQuery - { - $query = $this->createMockForAbstract( - MailFolderListQuery::class, - [], - [new ParameterBag()] - ); - - if ($fields) { - $query->expects($this->any())->method("getFields")->willReturn($fields); - } else { - $query->expects($this->any())->method("getFields")->willReturn( - (new MailFolderResource())->getFields() - ); - } - - return $query; - } } diff --git a/tests/MailClient/Data/Protocol/Imap/ImapClientExceptionTest.php b/tests/Mail/Client/Imap/ImapClientExceptionTest.php similarity index 86% rename from tests/MailClient/Data/Protocol/Imap/ImapClientExceptionTest.php rename to tests/Mail/Client/Imap/ImapClientExceptionTest.php index 8ba11a85..ac1569ae 100644 --- a/tests/MailClient/Data/Protocol/Imap/ImapClientExceptionTest.php +++ b/tests/Mail/Client/Imap/ImapClientExceptionTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Protocol\Imap; +namespace Tests\Conjoon\Mail\Client\Imap; -use Conjoon\MailClient\Data\Protocol\Imap\ImapClientException; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\Imap\ImapClientException; +use Conjoon\Mail\Client\MailClientException; use Tests\TestCase; /** * Class ImapClientExceptionTest - * @package Tests\Conjoon\MailClient\Data\Protocol\Imap\Util + * @package Tests\Conjoon\Mail\Client\Imap\Util */ class ImapClientExceptionTest extends TestCase { diff --git a/tests/MailClient/Data/Protocol/Imap/Util/DefaultFolderIdToTypeMapperTest.php b/tests/Mail/Client/Imap/Util/DefaultFolderIdToTypeMapperTest.php similarity index 94% rename from tests/MailClient/Data/Protocol/Imap/Util/DefaultFolderIdToTypeMapperTest.php rename to tests/Mail/Client/Imap/Util/DefaultFolderIdToTypeMapperTest.php index 4893746b..3a7993c6 100644 --- a/tests/MailClient/Data/Protocol/Imap/Util/DefaultFolderIdToTypeMapperTest.php +++ b/tests/Mail/Client/Imap/Util/DefaultFolderIdToTypeMapperTest.php @@ -27,13 +27,13 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Protocol\Imap\Util; +namespace Tests\Conjoon\Mail\Client\Imap\Util; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Folder\FolderIdToTypeMapper; -use Conjoon\MailClient\Folder\ListMailFolder; -use Conjoon\MailClient\Folder\MailFolder; -use Conjoon\MailClient\Data\Protocol\Imap\Util\DefaultFolderIdToTypeMapper; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Folder\FolderIdToTypeMapper; +use Conjoon\Mail\Client\Folder\ListMailFolder; +use Conjoon\Mail\Client\Folder\MailFolder; +use Conjoon\Mail\Client\Imap\Util\DefaultFolderIdToTypeMapper; use Tests\TestCase; /** @@ -80,6 +80,7 @@ public function testGetFolderType() $this->assertSame( MailFolder::TYPE_DRAFT, $mapper->getFolderType($this->createListMailFolder("INBOX.Drafts", ".")) + ); $this->assertSame( MailFolder::TYPE_DRAFT, @@ -155,8 +156,7 @@ public function testGetFolderType() // FOLDER - foreach ( - [ + foreach ([ ["SomeRandomFolder/Draft", "/"], ["SomeRandomFolder/Draft/Test", "/"], ["SomeRandom", "."], @@ -164,8 +164,7 @@ public function testGetFolderType() ["INBOX.Trash.Deep.Deeper.Folder", "."], ["Junk/Draft", "/"], ["TRASH.Draft.folder", "."] - ] as $folder - ) { + ] as $folder) { $this->assertSame( MailFolder::TYPE_FOLDER, $mapper->getFolderType($this->createListMailFolder($folder[0], $folder[1])) @@ -208,6 +207,7 @@ public function testGetFolderType() $mapper->getFolderType($this->createListMailFolder("[$label]/Trash", ".")) ); } + } @@ -229,8 +229,7 @@ public function createListMailFolder($id, $delimiter): ListMailFolder new FolderKey("dev", $id), ["name" => array_pop($parts), "delimiter" => $delimiter, - "unreadMessages" => 0, - "totalMessages" => 100] + "unreadCount" => 0] ); } diff --git a/tests/MailClient/Exception/MailClientExceptionTest.php b/tests/Mail/Client/MailClientExceptionTest.php similarity index 91% rename from tests/MailClient/Exception/MailClientExceptionTest.php rename to tests/Mail/Client/MailClientExceptionTest.php index d33b0499..03714dec 100644 --- a/tests/MailClient/Exception/MailClientExceptionTest.php +++ b/tests/Mail/Client/MailClientExceptionTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Exception; +namespace Tests\Conjoon\Mail\Client; -use Conjoon\MailClient\Exception\MailClientException; +use Conjoon\Mail\Client\MailClientException; use RuntimeException; use Tests\TestCase; /** * Class MailClientExceptionTest - * @package Tests\Conjoon\MailClient\Exception + * @package Tests\Conjoon\Mail\Client */ class MailClientExceptionTest extends TestCase { diff --git a/tests/MailClient/Message/AbstractMessageItemTest.php b/tests/Mail/Client/Message/AbstractMessageItemTest.php similarity index 88% rename from tests/MailClient/Message/AbstractMessageItemTest.php rename to tests/Mail/Client/Message/AbstractMessageItemTest.php index df99d028..f756defc 100644 --- a/tests/MailClient/Message/AbstractMessageItemTest.php +++ b/tests/Mail/Client/Message/AbstractMessageItemTest.php @@ -27,36 +27,29 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; - -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\Flag\DraftFlag; -use Conjoon\MailClient\Message\Flag\FlaggedFlag; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\Flag\SeenFlag; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\Data\Modifiable; +namespace Tests\Conjoon\Mail\Client\Message; + +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\Flag\DraftFlag; +use Conjoon\Mail\Client\Message\Flag\FlaggedFlag; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\Flag\SeenFlag; +use Conjoon\Util\Jsonable; +use Conjoon\Util\Modifiable; use DateTime; -use Tests\JsonableTestTrait; use Tests\TestCase; use TypeError; /** * Class AbstractMessageItemTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class AbstractMessageItemTest extends TestCase { - use JsonableTestTrait; - - // --------------------- // Tests // --------------------- @@ -67,7 +60,8 @@ class AbstractMessageItemTest extends TestCase public function testConstructor() { - $messageItem = $this->createMessageItem($this->createMessageKey()); + $messageItem = $this->createMessageItem(); + $this->assertInstanceOf(Jsonable::class, $messageItem); $this->assertInstanceOf(Modifiable::class, $messageItem); $this->assertNull($messageItem->getSeen()); @@ -81,24 +75,6 @@ public function testConstructor() $this->assertNull($messageItem->getinReplyTo()); } - /** - * Tests instance - */ - public function testConstructorNoMessageKey() - { - $messageItem = $this->createMessageItem(); - $this->assertNull($messageItem->getMessageKey()); - } - - /** - * Tests instance - */ - public function testConstructorNoMessageKeyButData() - { - $messageItem = $this->createMessageItem(null, ["subject" => "subject"]); - $this->assertNull($messageItem->getMessageKey()); - $this->assertSame("subject", $messageItem->getSubject()); - } /** * Test class. @@ -189,13 +165,13 @@ public function testTypeException() /** - * Test toArray + * Test toJson */ - public function testToArray() + public function testToJson() { $key = $this->createMessageKey(); $item = array_merge( - $key->toArray(), + $key->toJson(), $this->getItemConfig(true) ); unset($item["charset"]); @@ -217,18 +193,6 @@ public function testToArray() } - /** - * Test toJson - */ - public function testToJson() - { - $key = $this->createMessageKey(); - $messageItem = $this->createMessageItem($key, $this->getItemConfig()); - - $this->runToJsonTest($messageItem); - } - - /** * Test setFrom /w null */ @@ -429,7 +393,9 @@ public function testSetInReplyToException() protected function createMessageItem(MessageKey $key = null, array $data = null): AbstractMessageItem { // Create a new instance from the Abstract Class - + if (!$key) { + $key = $this->createMessageKey(); + } return new class ($key, $data) extends AbstractMessageItem { }; } diff --git a/tests/MailClient/Message/DraftTraitTest.php b/tests/Mail/Client/Message/DraftTraitTest.php similarity index 86% rename from tests/MailClient/Message/DraftTraitTest.php rename to tests/Mail/Client/Message/DraftTraitTest.php index 05483795..5125fce3 100644 --- a/tests/MailClient/Message/DraftTraitTest.php +++ b/tests/Mail/Client/Message/DraftTraitTest.php @@ -27,21 +27,21 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; - -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\DraftTrait; -use Conjoon\MailClient\Message\ListMessageItem; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessagePart; +namespace Tests\Conjoon\Mail\Client\Message; + +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\DraftTrait; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessagePart; use Tests\TestCase; /** * Class ListMessageItemTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class DraftTraitTest extends TestCase { diff --git a/tests/MailClient/Message/Flag/AbstractFlagTest.php b/tests/Mail/Client/Message/Flag/AbstractFlagTest.php similarity index 93% rename from tests/MailClient/Message/Flag/AbstractFlagTest.php rename to tests/Mail/Client/Message/Flag/AbstractFlagTest.php index 3401352d..0ffd58fc 100644 --- a/tests/MailClient/Message/Flag/AbstractFlagTest.php +++ b/tests/Mail/Client/Message/Flag/AbstractFlagTest.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Flag; +namespace Tests\Conjoon\Mail\Client\Message\Flag; -use Conjoon\MailClient\Message\Flag\AbstractFlag; +use Conjoon\Mail\Client\Message\Flag\AbstractFlag; use Tests\TestCase; /** * Class AbstractFlagTest - * @package Tests\Conjoon\MailClient\Message\Flag + * @package Tests\Conjoon\Mail\Client\Message\Flag */ class AbstractFlagTest extends TestCase { diff --git a/tests/MailClient/Message/Flag/AnsweredFlagTest.php b/tests/Mail/Client/Message/Flag/AnsweredFlagTest.php similarity index 89% rename from tests/MailClient/Message/Flag/AnsweredFlagTest.php rename to tests/Mail/Client/Message/Flag/AnsweredFlagTest.php index af1155af..bf3bb97d 100644 --- a/tests/MailClient/Message/Flag/AnsweredFlagTest.php +++ b/tests/Mail/Client/Message/Flag/AnsweredFlagTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Flag; +namespace Tests\Conjoon\Mail\Client\Message\Flag; -use Conjoon\MailClient\Message\Flag\AbstractFlag; -use Conjoon\MailClient\Message\Flag\AnsweredFlag; +use Conjoon\Mail\Client\Message\Flag\AbstractFlag; +use Conjoon\Mail\Client\Message\Flag\AnsweredFlag; use Tests\TestCase; /** * Class AnsweredFlagTest - * @package Tests\Conjoon\MailClient\Message\Flag + * @package Tests\Conjoon\Mail\Client\Message\Flag */ class AnsweredFlagTest extends TestCase { diff --git a/tests/MailClient/Message/Flag/DraftFlagTest.php b/tests/Mail/Client/Message/Flag/DraftFlagTest.php similarity index 89% rename from tests/MailClient/Message/Flag/DraftFlagTest.php rename to tests/Mail/Client/Message/Flag/DraftFlagTest.php index ff158321..8b58cc6e 100644 --- a/tests/MailClient/Message/Flag/DraftFlagTest.php +++ b/tests/Mail/Client/Message/Flag/DraftFlagTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Flag; +namespace Tests\Conjoon\Mail\Client\Message\Flag; -use Conjoon\MailClient\Message\Flag\AbstractFlag; -use Conjoon\MailClient\Message\Flag\DraftFlag; +use Conjoon\Mail\Client\Message\Flag\AbstractFlag; +use Conjoon\Mail\Client\Message\Flag\DraftFlag; use Tests\TestCase; /** * Class DraftFlagTest - * @package Tests\Conjoon\MailClient\Message\Flag + * @package Tests\Conjoon\Mail\Client\Message\Flag */ class DraftFlagTest extends TestCase { diff --git a/tests/MailClient/Message/Flag/FlagListTest.php b/tests/Mail/Client/Message/Flag/FlagListTest.php similarity index 84% rename from tests/MailClient/Message/Flag/FlagListTest.php rename to tests/Mail/Client/Message/Flag/FlagListTest.php index 2ff4567e..e6f59efe 100644 --- a/tests/MailClient/Message/Flag/FlagListTest.php +++ b/tests/Mail/Client/Message/Flag/FlagListTest.php @@ -27,19 +27,19 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Flag; +namespace Tests\Conjoon\Mail\Client\Message\Flag; -use Conjoon\MailClient\Message\Flag\AbstractFlag; -use Conjoon\MailClient\Message\Flag\AnsweredFlag; -use Conjoon\MailClient\Message\Flag\DraftFlag; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\Flag\SeenFlag; -use Conjoon\Core\AbstractList; +use Conjoon\Mail\Client\Message\Flag\AbstractFlag; +use Conjoon\Mail\Client\Message\Flag\AnsweredFlag; +use Conjoon\Mail\Client\Message\Flag\DraftFlag; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\Flag\SeenFlag; +use Conjoon\Util\AbstractList; use Tests\TestCase; /** * Class FlagListTest - * @package Tests\Conjoon\MailClient\Message\Flag + * @package Tests\Conjoon\Mail\Client\Message\Flag */ class FlagListTest extends TestCase { diff --git a/tests/MailClient/Message/Flag/FlaggedFlagTest.php b/tests/Mail/Client/Message/Flag/FlaggedFlagTest.php similarity index 89% rename from tests/MailClient/Message/Flag/FlaggedFlagTest.php rename to tests/Mail/Client/Message/Flag/FlaggedFlagTest.php index 767b440b..62193255 100644 --- a/tests/MailClient/Message/Flag/FlaggedFlagTest.php +++ b/tests/Mail/Client/Message/Flag/FlaggedFlagTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Flag; +namespace Tests\Conjoon\Mail\Client\Message\Flag; -use Conjoon\MailClient\Message\Flag\AbstractFlag; -use Conjoon\MailClient\Message\Flag\FlaggedFlag; +use Conjoon\Mail\Client\Message\Flag\AbstractFlag; +use Conjoon\Mail\Client\Message\Flag\FlaggedFlag; use Tests\TestCase; /** * Class FlaggedFlagTest - * @package Tests\Conjoon\MailClient\Message\Flag + * @package Tests\Conjoon\Mail\Client\Message\Flag */ class FlaggedFlagTest extends TestCase { diff --git a/tests/MailClient/Message/Flag/SeenFlagTest.php b/tests/Mail/Client/Message/Flag/SeenFlagTest.php similarity index 89% rename from tests/MailClient/Message/Flag/SeenFlagTest.php rename to tests/Mail/Client/Message/Flag/SeenFlagTest.php index f7184da2..de985196 100644 --- a/tests/MailClient/Message/Flag/SeenFlagTest.php +++ b/tests/Mail/Client/Message/Flag/SeenFlagTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Flag; +namespace Tests\Conjoon\Mail\Client\Message\Flag; -use Conjoon\MailClient\Message\Flag\AbstractFlag; -use Conjoon\MailClient\Message\Flag\SeenFlag; +use Conjoon\Mail\Client\Message\Flag\AbstractFlag; +use Conjoon\Mail\Client\Message\Flag\SeenFlag; use Tests\TestCase; /** * Class SeenFlagTest - * @package Tests\Conjoon\MailClient\Message\Flag + * @package Tests\Conjoon\Mail\Client\Message\Flag */ class SeenFlagTest extends TestCase { diff --git a/tests/Mail/Client/Message/ListMessageItemTest.php b/tests/Mail/Client/Message/ListMessageItemTest.php new file mode 100644 index 00000000..4b8c5f25 --- /dev/null +++ b/tests/Mail/Client/Message/ListMessageItemTest.php @@ -0,0 +1,165 @@ +assertContains(DraftTrait::class, $uses); + + $messageKey = $this->createMessageKey(); + $messageItem = new ListMessageItem($messageKey, null, $this->createMessagePart()); + $this->assertInstanceOf(MessageItem::class, $messageItem); + } + + + /** + * Test class. + */ + public function testClass() + { + + $previewText = "foobar"; + + $messageKey = $this->createMessageKey(); + + $messageItem = new ListMessageItem( + $messageKey, + ["subject" => "YO!"], + $this->createMessagePart($previewText, "UTF-8", "text/plain") + ); + + $this->assertNull($messageItem->getDraft()); + $messageItem->setDraft(true); + + $this->assertSame($previewText, $messageItem->getMessagePart()->getContents()); + + $mp = $messageItem->getMessagePart(); + + $mp->setContents("snafu", "UTF-8"); + $this->assertSame("snafu", $messageItem->getMessagePart()->getContents()); + + $this->assertSame($messageItem, $messageItem->setMessagePart(null)); + $this->assertNull($messageItem->getMessagePart()); + $this->assertSame($messageItem, $messageItem->setMessagePart($mp)); + $this->assertSame($mp, $messageItem->getMessagePart()); + + $cc = $this->createAddresses(1); + $messageItem->setCc($cc); + $bcc = $this->createAddresses(2); + $messageItem->setBcc($bcc); + $replyTo = $this->createAddress(3); + $messageItem->setReplyTo($replyTo); + + $arr = $messageItem->toJson(); + $this->assertSame("YO!", $arr["subject"]); + $this->assertTrue($arr["draft"]); + + $this->assertEquals($cc->toJson(), $arr["cc"]); + $this->assertEquals($bcc->toJson(), $arr["bcc"]); + $this->assertEquals($replyTo->toJson(), $arr["replyTo"]); + + $this->assertSame("snafu", $arr["previewText"]); + } + + + +// --------------------- +// Helper Functions +// --------------------- + + /** + * @return MailAddressList + */ + protected function createAddresses($id): MailAddressList + { + + $list = new MailAddressList(); + + $list[] = $this->createAddress($id); + + return $list; + } + + + /** + * @return MailAddress + */ + protected function createAddress($id): MailAddress + { + return new MailAddress("name{$id}", "name{$id}@address.testcomdomaindev"); + } + + + /** + * Returns a MessageKey. + * + * @param string $mailAccountId + * @param string $mailFolderId + * @param string $id + * + * @return MessageKey + */ + protected function createMessageKey( + string $mailAccountId = "dev", + string $mailFolderId = "INBOX", + string $id = "232" + ): MessageKey { + return new MessageKey($mailAccountId, $mailFolderId, $id); + } + + + protected function createMessagePart($text = "a", $charset = "b", $mimeType = "c"): MessagePart + { + return new MessagePart($text, $charset, $mimeType); + } +} diff --git a/tests/MailClient/Message/MessageBodyDraftTest.php b/tests/Mail/Client/Message/MessageBodyDraftTest.php similarity index 72% rename from tests/MailClient/Message/MessageBodyDraftTest.php rename to tests/Mail/Client/Message/MessageBodyDraftTest.php index 1b743b2e..61878e95 100644 --- a/tests/MailClient/Message/MessageBodyDraftTest.php +++ b/tests/Mail/Client/Message/MessageBodyDraftTest.php @@ -27,26 +27,21 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; - -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\AbstractMessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\Core\Contract\Jsonable; -use Tests\JsonableTestTrait; +namespace Tests\Conjoon\Mail\Client\Message; + +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\AbstractMessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Util\Jsonable; use Tests\TestCase; /** * Class MessageBodyDraftTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class MessageBodyDraftTest extends TestCase { - use JsonableTestTrait; - - // --------------------- // Tests // --------------------- @@ -61,30 +56,27 @@ public function testClass() $this->assertInstanceOf(Jsonable::class, $body); $this->assertInstanceOf(AbstractMessageBody::class, $body); - $plainPart = new MessagePart("foo", "ISO-8859-1", MimeType::TEXT_PLAIN); - $htmlPart = new MessagePart("bar", "UTF-8", MimeType::TEXT_HTML); + $plainPart = new MessagePart("foo", "ISO-8859-1", "text/plain"); + $htmlPart = new MessagePart("bar", "UTF-8", "text/html"); $this->assertEquals([ - "type" => "MessageBody", "textPlain" => "", "textHtml" => "" - ], $body->toArray()); + ], $body->toJson()); $body->setTextPlain($plainPart); $this->assertEquals([ - "type" => "MessageBody", "textPlain" => "foo", "textHtml" => "" - ], $body->toArray()); + ], $body->toJson()); $body->setTextHtml($htmlPart); $this->assertEquals([ - "type" => "MessageBody", "textPlain" => "foo", "textHtml" => "bar" - ], $body->toArray()); + ], $body->toJson()); $this->assertSame($plainPart, $body->getTextPlain()); $this->assertSame($htmlPart, $body->getTextHtml()); @@ -93,23 +85,12 @@ public function testClass() $body = new MessageBodyDraft(new MessageKey("a", "b", "c")); $this->assertEquals([ - "type" => "MessageBody", "mailAccountId" => "a", "mailFolderId" => "b", "id" => "c", "textPlain" => "", "textHtml" => "" - ], $body->toArray()); - } - - - /** - * Test toJson - */ - public function testToJson() - { - $body = new MessageBodyDraft(); - $this->runToJsonTest($body); + ], $body->toJson()); } @@ -121,8 +102,8 @@ public function testSetMessageKey() $body = new MessageBodyDraft(new MessageKey("a", "b", "c")); - $plainPart = new MessagePart("foo", "ISO-8859-1", MimeType::TEXT_PLAIN); - $htmlPart = new MessagePart("bar", "UTF-8", MimeType::TEXT_HTML); + $plainPart = new MessagePart("foo", "ISO-8859-1", "text/plain"); + $htmlPart = new MessagePart("bar", "UTF-8", "text/html"); $body->setTextPlain($plainPart); $body->setTextHtml($htmlPart); diff --git a/tests/MailClient/Message/MessageBodyTest.php b/tests/Mail/Client/Message/MessageBodyTest.php similarity index 65% rename from tests/MailClient/Message/MessageBodyTest.php rename to tests/Mail/Client/Message/MessageBodyTest.php index 5713fb14..107403bc 100644 --- a/tests/MailClient/Message/MessageBodyTest.php +++ b/tests/Mail/Client/Message/MessageBodyTest.php @@ -27,24 +27,20 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; +namespace Tests\Conjoon\Mail\Client\Message; -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\AbstractMessageBody; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessagePart; -use Tests\JsonableTestTrait; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\AbstractMessageBody; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessagePart; use Tests\TestCase; /** * Class MessageBodyTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class MessageBodyTest extends TestCase { - use JsonableTestTrait; - // --------------------- // Tests // --------------------- @@ -53,52 +49,27 @@ class MessageBodyTest extends TestCase */ public function testClass() { + $messageKey = new MessageKey("dev", "INBOX", "232"); - $body = $this->createMessageBody($messageKey); + + $body = new MessageBody($messageKey); $this->assertInstanceOf(AbstractMessageBody::class, $body); + $plainPart = new MessagePart("foo", "ISO-8859-1", "text/plain"); + $htmlPart = new MessagePart("bar", "UTF-8", "text/html"); + + $body->setTextPlain($plainPart); + $body->setTextHtml($htmlPart); + $this->assertSame($messageKey, $body->getMessageKey()); $this->assertEquals([ - "type" => "MessageBody", "mailAccountId" => "dev", "mailFolderId" => "INBOX", "id" => "232", "textPlain" => "foo", "textHtml" => "bar" - ], $body->toArray()); - } - - - /** - * Test toJson - */ - public function testToJson() - { - $body = $this->createMessageBody(); - - $this->runToJsonTest($body); - } - - - /** - * @return void - */ - protected function createMessageBody($messageKey = null) - { - if ($messageKey === null) { - $messageKey = new MessageKey("dev", "INBOX", "232"); - } - - $body = new MessageBody($messageKey); - - $plainPart = new MessagePart("foo", "ISO-8859-1", MimeType::TEXT_PLAIN); - $htmlPart = new MessagePart("bar", "UTF-8", MimeType::TEXT_HTML); - - $body->setTextPlain($plainPart); - $body->setTextHtml($htmlPart); - - return $body; + ], $body->toJson()); } } diff --git a/tests/MailClient/Message/MessageItemDraftTest.php b/tests/Mail/Client/Message/MessageItemDraftTest.php similarity index 87% rename from tests/MailClient/Message/MessageItemDraftTest.php rename to tests/Mail/Client/Message/MessageItemDraftTest.php index e278d0cd..17ea21fa 100644 --- a/tests/MailClient/Message/MessageItemDraftTest.php +++ b/tests/Mail/Client/Message/MessageItemDraftTest.php @@ -27,22 +27,22 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; - -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\DraftTrait; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\Data\Modifiable; +namespace Tests\Conjoon\Mail\Client\Message; + +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\DraftTrait; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Util\Modifiable; use Tests\TestCase; use TypeError; /** * Class MessageItemDraftTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class MessageItemDraftTest extends TestCase { @@ -65,7 +65,6 @@ public function testConstructor() $this->assertTrue($messageItem->getDraft()); } - /** * Tests setMessageKey */ @@ -83,8 +82,8 @@ public function testSetMessageKey() $this->assertSame([], $messageItem->getModifiedFields()); $this->assertSame([], $newItem->getModifiedFields()); - $newItem->toArray(); - $oldJson = $messageItem->toArray(); + $newItem->toJson(); + $oldJson = $messageItem->toJson(); $expCaught = count(array_keys($oldJson)) - 3; // w/o messageKey data @@ -154,9 +153,9 @@ public function testTypeException() /** - * Test toArray + * Test toJson */ - public function testToArray() + public function testToJson() { $item = $this->getItemConfig(); @@ -166,16 +165,16 @@ public function testToArray() $keys = array_keys($item); - $skipFields = ["draftInfo"]; + $skipFields = ["xCnDraftInfo"]; foreach ($keys as $key) { if (in_array($key, $skipFields)) { continue; } if (in_array($key, ["from", "replyTo", "to", "cc", "bcc"])) { - $this->assertEquals($item[$key]->toArray(), $messageItem->toArray()[$key]); + $this->assertEquals($item[$key]->toJson(), $messageItem->toJson()[$key]); } else { - $this->assertSame($item[$key], $messageItem->toArray()[$key]); + $this->assertSame($item[$key], $messageItem->toJson()[$key]); } } @@ -184,15 +183,15 @@ public function testToArray() $messageItem = $this->createMessageItem($messageKey, $item); - $json = $messageItem->toArray(); - $keyJson = $messageKey->toArray(); + $json = $messageItem->toJson(); + $keyJson = $messageKey->toJson(); $this->assertSame($json["id"], $keyJson["id"]); $this->assertSame($json["mailAccountId"], $keyJson["mailAccountId"]); $this->assertSame($json["mailFolderId"], $keyJson["mailFolderId"]); $messageItem = $this->createMessageItem(); - $json = $messageItem->toArray(); + $json = $messageItem->toJson(); $this->assertArrayNotHasKey("replyTo", $json); $this->assertArrayNotHasKey("cc", $json); @@ -242,7 +241,7 @@ public function testAddressesNull() $messageItem->setCc(); $messageItem->setBcc(); - $json = $messageItem->toArray(); + $json = $messageItem->toJson(); $this->assertArrayNotHasKey("from", $json); $this->assertArrayNotHasKey("replyTo", $json); @@ -280,39 +279,39 @@ public function testIsHeaderField() /** - * Tests draftInfo Field w/ setters and getters + * Tests xCnDraftInfo Field w/ setters and getters */ public function testXCnDraftInfo() { $draft = $this->createMessageItem(null, $this->getItemConfig()); - $this->assertSame($draft->getDraftInfo(), $this->getItemConfig()["draftInfo"]); + $this->assertSame($draft->getXCnDraftInfo(), $this->getItemConfig()["xCnDraftInfo"]); $draft = $this->createMessageItem(null, ["messageId" => "mid"]); $val = "draftinfo"; - $draft->setDraftInfo($val); - $this->assertSame($draft->getDraftInfo(), $val); + $draft->setXCnDraftInfo($val); + $this->assertSame($draft->getXCnDraftInfo(), $val); $draft = $this->createMessageItem(null, ["messageId" => "mid"]); - $draft->setDraftInfo(); - $this->assertNull($draft->getDraftInfo()); + $draft->setXCnDraftInfo(); + $this->assertNull($draft->getXCnDraftInfo()); } /** - * Tests setting draftInfo if already set + * Tests setting xCnDraftInfo if already set */ - public function testSetDraftInfoException() + public function testSetXCnDraftInfoException() { $draft = $this->createMessageItem(null, $this->getItemConfig()); - $this->assertNotNull($draft->getDraftInfo()); + $this->assertNotNull($draft->getXCnDraftInfo()); $this->expectException(MailClientException::class); - $draft->setDraftInfo("foo"); + $draft->setXCnDraftInfo("foo"); } // --------------------- @@ -332,7 +331,7 @@ protected function getItemConfig(): array "cc" => $this->createCc(), "bcc" => $this->createBcc(), "draft" => true, - "draftInfo" => "WyJzaXRlYXJ0d29yayIsIklOQk9YIiwiMTU5NzUyIl0=" + "xCnDraftInfo" => "WyJzaXRlYXJ0d29yayIsIklOQk9YIiwiMTU5NzUyIl0=" ]; } diff --git a/tests/MailClient/Message/MessageItemListTest.php b/tests/Mail/Client/Message/MessageItemListTest.php similarity index 63% rename from tests/MailClient/Message/MessageItemListTest.php rename to tests/Mail/Client/Message/MessageItemListTest.php index 4c3f4a99..bb257c27 100644 --- a/tests/MailClient/Message/MessageItemListTest.php +++ b/tests/Mail/Client/Message/MessageItemListTest.php @@ -27,24 +27,22 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; +namespace Tests\Conjoon\Mail\Client\Message; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\Core\AbstractList; -use Tests\JsonableTestTrait; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Util\AbstractList; +use Conjoon\Util\Jsonable; use Tests\TestCase; /** * Class MessageItemListTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class MessageItemListTest extends TestCase { - use JsonableTestTrait; - // --------------------- // Tests // --------------------- @@ -55,37 +53,27 @@ class MessageItemListTest extends TestCase public function testClass() { - $messageItemList = $this->createList(); + $messageItemList = new MessageItemList(); $this->assertInstanceOf(AbstractList::class, $messageItemList); - $this->assertInstanceOf(Arrayable::class, $messageItemList); - $this->assertSame(MessageItem::class, $messageItemList->getEntityType()); + $this->assertInstanceOf(Jsonable::class, $messageItemList); - $this->assertSame([ - $messageItemList[0]->toArray(), - $messageItemList[1]->toArray() - ], $messageItemList->toArray()); - } + $this->assertSame(ListMessageItem::class, $messageItemList->getEntityType()); - - public function testToJson() - { - $messageItemList = $this->createList(); - $this->runToJsonTest($messageItemList); - } - - - protected function createList() - { - $messageItemList = new MessageItemList(); - $messageItemList[] = new MessageItem( + $messageItemList[] = new ListMessageItem( new MessageKey("dev", "INBOX", "1"), - null + null, + new MessagePart("foo", "bar", "text/plain") ); - $messageItemList[] = new MessageItem( + $messageItemList[] = new ListMessageItem( new MessageKey("dev", "INBOX", "2"), - null + null, + new MessagePart("foo", "bar", "text/plain") ); - return $messageItemList; + + $this->assertSame([ + $messageItemList[0]->toJson(), + $messageItemList[1]->toJson() + ], $messageItemList->toJson()); } } diff --git a/tests/MailClient/Message/MessageItemTest.php b/tests/Mail/Client/Message/MessageItemTest.php similarity index 89% rename from tests/MailClient/Message/MessageItemTest.php rename to tests/Mail/Client/Message/MessageItemTest.php index 25490f73..8304e9ec 100644 --- a/tests/MailClient/Message/MessageItemTest.php +++ b/tests/Mail/Client/Message/MessageItemTest.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; +namespace Tests\Conjoon\Mail\Client\Message; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\MessageItem; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\MessageItem; use Tests\TestCase; use TypeError; /** * Class MessageItemTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class MessageItemTest extends TestCase { @@ -101,21 +101,17 @@ public function testTypeException() /** - * tests toArray() + * toJson() */ - public function testToArray() + public function testToJson() { $messageKey = $this->createMessageKey(); $item = $this->createMessageItem($this->createMessageKey(), $this->getItemConfig()); - $json = $item->toArray(); + $json = $item->toJson(); - $expected = array_merge( - ["type" => "MessageItem"], - $messageKey->toArray(), - $this->getItemConfig() - ); + $expected = array_merge($messageKey->toJson(), $this->getItemConfig()); unset($expected["charset"]); ksort($expected); diff --git a/tests/MailClient/Message/MessagePartTest.php b/tests/Mail/Client/Message/MessagePartTest.php similarity index 82% rename from tests/MailClient/Message/MessagePartTest.php rename to tests/Mail/Client/Message/MessagePartTest.php index 6ef16f6d..ad0b3f45 100644 --- a/tests/MailClient/Message/MessagePartTest.php +++ b/tests/Mail/Client/Message/MessagePartTest.php @@ -27,16 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message; +namespace Tests\Conjoon\Mail\Client\Message; -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\Core\Contract\Copyable; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Util\Copyable; use Tests\TestCase; /** * Class MessagePartTest - * @package Tests\Conjoon\MailClient\Message + * @package Tests\Conjoon\Mail\Client\Message */ class MessagePartTest extends TestCase { @@ -50,19 +49,19 @@ public function testClass() { - $messagePart = new MessagePart("foo", "bar", MimeType::TEXT_HTML); + $messagePart = new MessagePart("foo", "bar", "text/html"); $this->assertInstanceOf(Copyable::class, $messagePart); $this->assertSame("foo", $messagePart->getContents()); $this->assertSame("bar", $messagePart->getCharset()); - $this->assertSame(MimeType::TEXT_HTML, $messagePart->getMimeType()); + $this->assertSame("text/html", $messagePart->getMimeType()); $messagePart->setContents("contents", "charset"); $this->assertSame("contents", $messagePart->getContents()); $this->assertSame("charset", $messagePart->getCharset()); - $this->assertSame(MimeType::TEXT_HTML, $messagePart->getMimeType()); + $this->assertSame("text/html", $messagePart->getMimeType()); $copy = $messagePart->copy(); $this->assertNotSame($copy, $messagePart); diff --git a/tests/MailClient/Message/Text/AbstractMessagePartContentProcessorTest.php b/tests/Mail/Client/Message/Text/AbstractMessagePartContentProcessorTest.php similarity index 84% rename from tests/MailClient/Message/Text/AbstractMessagePartContentProcessorTest.php rename to tests/Mail/Client/Message/Text/AbstractMessagePartContentProcessorTest.php index 22020c05..0f4aac82 100644 --- a/tests/MailClient/Message/Text/AbstractMessagePartContentProcessorTest.php +++ b/tests/Mail/Client/Message/Text/AbstractMessagePartContentProcessorTest.php @@ -27,21 +27,20 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Text; - -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessor; -use Conjoon\MailClient\Message\Text\HtmlTextStrategy; -use Conjoon\MailClient\Message\Text\MessagePartContentProcessor; -use Conjoon\MailClient\Message\Text\PlainTextStrategy; -use Conjoon\MailClient\Message\Text\ProcessorException; +namespace Tests\Conjoon\Mail\Client\Message\Text; + +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessor; +use Conjoon\Mail\Client\Message\Text\HtmlTextStrategy; +use Conjoon\Mail\Client\Message\Text\MessagePartContentProcessor; +use Conjoon\Mail\Client\Message\Text\PlainTextStrategy; +use Conjoon\Mail\Client\Message\Text\ProcessorException; use Conjoon\Text\Converter; use Tests\TestCase; /** * Class AbstractMessagePartContentProcessorTest - * @package Tests\Conjoon\MailClient\Message\Text + * @package Tests\Conjoon\Mail\Client\Message\Text */ class AbstractMessagePartContentProcessorTest extends TestCase { @@ -65,7 +64,7 @@ public function testProcessException() $processor = $this->createProcessor(); - $mp = new MessagePart("foo", "UTF-8", MimeType::IMAGE_JPEG); + $mp = new MessagePart("foo", "UTF-8", "image/jpg"); $processor->process($mp); } @@ -79,8 +78,8 @@ public function testProcess() $processor = $this->createProcessor(); - $textPlain = new MessagePart("IsPlain", "FROM UTF-8", MimeType::TEXT_PLAIN); - $textHtml = new MessagePart("html", "FROM UTF-8", MimeType::TEXT_HTML); + $textPlain = new MessagePart("IsPlain", "FROM UTF-8", "text/plain"); + $textHtml = new MessagePart("html", "FROM UTF-8", "text/html"); $processedTextPlain = $processor->process($textPlain, "ABC"); $this->assertSame("PLAINIsPlain FROM UTF-8 ABC", $textPlain->getContents()); diff --git a/tests/MailClient/Message/Text/DefaultMessageItemFieldsProcessorTest.php b/tests/Mail/Client/Message/Text/DefaultMessageItemFieldsProcessorTest.php similarity index 88% rename from tests/MailClient/Message/Text/DefaultMessageItemFieldsProcessorTest.php rename to tests/Mail/Client/Message/Text/DefaultMessageItemFieldsProcessorTest.php index 6aa05677..4f83ce43 100644 --- a/tests/MailClient/Message/Text/DefaultMessageItemFieldsProcessorTest.php +++ b/tests/Mail/Client/Message/Text/DefaultMessageItemFieldsProcessorTest.php @@ -27,19 +27,19 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Text; +namespace Tests\Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\Text\DefaultMessageItemFieldsProcessor; -use Conjoon\MailClient\Message\Text\MessageItemFieldsProcessor; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\Text\DefaultMessageItemFieldsProcessor; +use Conjoon\Mail\Client\Message\Text\MessageItemFieldsProcessor; use Conjoon\Text\Converter; use Tests\TestCase; /** * Class DefaultMessageItemFieldsProcessorTest - * @package Tests\Conjoon\MailClient\Message\Text + * @package Tests\Conjoon\Mail\Client\Message\Text */ class DefaultMessageItemFieldsProcessorTest extends TestCase { diff --git a/tests/MailClient/Message/Text/DefaultPreviewTextProcessorTest.php b/tests/Mail/Client/Message/Text/DefaultPreviewTextProcessorTest.php similarity index 86% rename from tests/MailClient/Message/Text/DefaultPreviewTextProcessorTest.php rename to tests/Mail/Client/Message/Text/DefaultPreviewTextProcessorTest.php index b1329282..73aacc5d 100644 --- a/tests/MailClient/Message/Text/DefaultPreviewTextProcessorTest.php +++ b/tests/Mail/Client/Message/Text/DefaultPreviewTextProcessorTest.php @@ -27,21 +27,21 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Text; - -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Message\Text\DefaultPreviewTextProcessor; -use Conjoon\MailClient\Message\Text\PreviewTextProcessor; -use Conjoon\MailClient\Message\Text\ProcessorException; -use Conjoon\MailClient\Data\Reader\HtmlReadableStrategy; -use Conjoon\MailClient\Data\Reader\PlainReadableStrategy; -use Conjoon\MailClient\Data\Reader\ReadableMessagePartContentProcessor; +namespace Tests\Conjoon\Mail\Client\Message\Text; + +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Message\Text\DefaultPreviewTextProcessor; +use Conjoon\Mail\Client\Message\Text\PreviewTextProcessor; +use Conjoon\Mail\Client\Message\Text\ProcessorException; +use Conjoon\Mail\Client\Reader\HtmlReadableStrategy; +use Conjoon\Mail\Client\Reader\PlainReadableStrategy; +use Conjoon\Mail\Client\Reader\ReadableMessagePartContentProcessor; use Conjoon\Text\Converter; use Tests\TestCase; /** - * Tests DefaultPreviewTextProcessorTest. + * Class DefaultPreviewTextProcessorTest + * @package Tests\Conjoon\Mail\Client\Message\Text */ class DefaultPreviewTextProcessorTest extends TestCase { @@ -69,7 +69,7 @@ public function testProcessException() $processor = $this->createProcessor(); - $mp = new MessagePart("foo", "UTF-8", MimeType::IMAGE_JPEG); + $mp = new MessagePart("foo", "UTF-8", "image/jpg"); $processor->process($mp); } @@ -85,8 +85,8 @@ public function testProcess() $length = 300; - $textPlain = new MessagePart(str_repeat("A", $length), "UTF-8", MimeType::TEXT_PLAIN); - $textHtml = new MessagePart("" . str_repeat("B", $length) . "", "UTF-8", MimeType::TEXT_HTML); + $textPlain = new MessagePart(str_repeat("A", $length), "UTF-8", "text/plain"); + $textHtml = new MessagePart("" . str_repeat("B", $length) . "", "UTF-8", "text/html"); $processedTextPlain = $processor->process($textPlain); $this->assertSame("CALLED" . str_repeat("A", $length), $processedTextPlain->getContents()); @@ -97,11 +97,11 @@ public function testProcess() $this->assertSame($textPlain, $processedTextPlain); $this->assertSame($textHtml, $processedTextHtml); - $textHtml = new MessagePart(" A > B", "UTF-8", MimeType::TEXT_HTML); + $textHtml = new MessagePart(" A > B", "UTF-8", "text/html"); $processedTextHtml = $processor->process($textHtml); $this->assertSame("CALLED A > B", $processedTextHtml->getContents()); - $textPlain = new MessagePart(str_repeat("A", $length), "UTF-8", MimeType::TEXT_PLAIN); + $textPlain = new MessagePart(str_repeat("A", $length), "UTF-8", "text/plain"); $processedTextPlain = $processor->process($textPlain, "UTF-8", ["length" => 10]); $def = "CALLED"; $this->assertSame("CALLED" . str_repeat("A", 10 - strlen($def)), $processedTextPlain->getContents()); diff --git a/tests/MailClient/Message/Text/ProcessorExceptionTest.php b/tests/Mail/Client/Message/Text/ProcessorExceptionTest.php similarity index 87% rename from tests/MailClient/Message/Text/ProcessorExceptionTest.php rename to tests/Mail/Client/Message/Text/ProcessorExceptionTest.php index 9f9ae660..979adde5 100644 --- a/tests/MailClient/Message/Text/ProcessorExceptionTest.php +++ b/tests/Mail/Client/Message/Text/ProcessorExceptionTest.php @@ -27,15 +27,15 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Message\Text; +namespace Tests\Conjoon\Mail\Client\Message\Text; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Message\Text\ProcessorException; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Mail\Client\Message\Text\ProcessorException; use Tests\TestCase; /** * Class ProcessorExceptionTest - * @package Tests\Conjoon\MailClient\Message\Text + * @package Tests\Conjoon\Mail\Client\Message\Text */ class ProcessorExceptionTest extends TestCase { diff --git a/tests/MailClient/Data/Resource/Query/MessageItemQueryTest.php b/tests/Mail/Client/Query/MessageItemListResourceQueryTest.php similarity index 69% rename from tests/MailClient/Data/Resource/Query/MessageItemQueryTest.php rename to tests/Mail/Client/Query/MessageItemListResourceQueryTest.php index 97976b4d..db7066d2 100644 --- a/tests/MailClient/Data/Resource/Query/MessageItemQueryTest.php +++ b/tests/Mail/Client/Query/MessageItemListResourceQueryTest.php @@ -3,7 +3,7 @@ /** * conjoon * php-lib-conjoon - * Copyright (C) 2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon + * Copyright (C) 2021-2022 Thorsten Suckow-Homberg https://github.com/conjoon/php-lib-conjoon * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -27,28 +27,25 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Resource\Query; +namespace Tests\Conjoon\Mail\Client\Query; -use Conjoon\Data\ParameterBag; -use Conjoon\Data\Resource\ResourceQuery; -use Conjoon\MailClient\Data\Resource\MessageItem; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; +use Conjoon\Core\ParameterBag; +use Conjoon\Core\ResourceQuery; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; use Tests\TestCase; /** - * Tests MessageItem. + * Class MessageItemListResourceQueryTest + * @package Tests\Conjoon\Mail\Client\Query */ -class MessageItemQueryTest extends TestCase +class MessageItemListResourceQueryTest extends TestCase { /** * test class */ public function testClass() { - $inst = $this->createMockForAbstract(MessageItemQuery::class, [], [new ParameterBag()]); + $inst = new MessageItemListResourceQuery(new ParameterBag([])); $this->assertInstanceOf(ResourceQuery::class, $inst); - - $this->assertInstanceOf(MessageItem::class, $inst->getResourceTarget( - )); } } diff --git a/tests/MailClient/Data/Reader/DefaultPlainReadableStrategyTest.php b/tests/Mail/Client/Reader/DefaultPlainReadableStrategyTest.php similarity index 88% rename from tests/MailClient/Data/Reader/DefaultPlainReadableStrategyTest.php rename to tests/Mail/Client/Reader/DefaultPlainReadableStrategyTest.php index 1e6596e5..d825dde3 100644 --- a/tests/MailClient/Data/Reader/DefaultPlainReadableStrategyTest.php +++ b/tests/Mail/Client/Reader/DefaultPlainReadableStrategyTest.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Reader; +namespace Tests\Conjoon\Mail\Client\Reader; -use Conjoon\MailClient\Message\Text\PlainTextStrategy; -use Conjoon\MailClient\Data\Reader\DefaultPlainReadableStrategy; -use Conjoon\MailClient\Data\Reader\PlainReadableStrategy; +use Conjoon\Mail\Client\Message\Text\PlainTextStrategy; +use Conjoon\Mail\Client\Reader\DefaultPlainReadableStrategy; +use Conjoon\Mail\Client\Reader\PlainReadableStrategy; use Tests\TestCase; class DefaultPlainReadableStrategyTest extends TestCase diff --git a/tests/MailClient/Data/Reader/PurifiedHtmlStrategyTest.php b/tests/Mail/Client/Reader/PurifiedHtmlStrategyTest.php similarity index 89% rename from tests/MailClient/Data/Reader/PurifiedHtmlStrategyTest.php rename to tests/Mail/Client/Reader/PurifiedHtmlStrategyTest.php index bfbba8b9..4a0d049c 100644 --- a/tests/MailClient/Data/Reader/PurifiedHtmlStrategyTest.php +++ b/tests/Mail/Client/Reader/PurifiedHtmlStrategyTest.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Reader; +namespace Tests\Conjoon\Mail\Client\Reader; -use Conjoon\MailClient\Message\Text\HtmlTextStrategy; -use Conjoon\MailClient\Data\Reader\HtmlReadableStrategy; -use Conjoon\MailClient\Data\Reader\PurifiedHtmlStrategy; +use Conjoon\Mail\Client\Message\Text\HtmlTextStrategy; +use Conjoon\Mail\Client\Reader\HtmlReadableStrategy; +use Conjoon\Mail\Client\Reader\PurifiedHtmlStrategy; use Tests\TestCase; class PurifiedHtmlStrategyTest extends TestCase diff --git a/tests/MailClient/Data/Reader/ReadableMessagePartContentProcessorTest.php b/tests/Mail/Client/Reader/ReadableMessagePartContentProcessorTest.php similarity index 88% rename from tests/MailClient/Data/Reader/ReadableMessagePartContentProcessorTest.php rename to tests/Mail/Client/Reader/ReadableMessagePartContentProcessorTest.php index 4b070f94..5901defd 100644 --- a/tests/MailClient/Data/Reader/ReadableMessagePartContentProcessorTest.php +++ b/tests/Mail/Client/Reader/ReadableMessagePartContentProcessorTest.php @@ -27,14 +27,14 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Reader; +namespace Tests\Conjoon\Mail\Client\Reader; -use Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessor; -use Conjoon\MailClient\Data\Reader\HtmlReadableStrategy; -use Conjoon\MailClient\Data\Reader\PlainReadableStrategy; -use Conjoon\MailClient\Data\Reader\ReadableMessagePartContentProcessor; +use Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessor; +use Conjoon\Mail\Client\Reader\HtmlReadableStrategy; +use Conjoon\Mail\Client\Reader\PlainReadableStrategy; +use Conjoon\Mail\Client\Reader\ReadableMessagePartContentProcessor; use Conjoon\Text\Converter; -use Tests\Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessorTest; +use Tests\Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessorTest; /** * Class DefaultMessagePartContentProcessorTest diff --git a/tests/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php b/tests/Mail/Client/Request/Message/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php similarity index 86% rename from tests/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php rename to tests/Mail/Client/Request/Message/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php index c5d091d0..708d1235 100644 --- a/tests/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php +++ b/tests/Mail/Client/Request/Message/Transformer/DefaultMessageBodyDraftJsonTransformerTest.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Protocol\Http\Request\Transformer; +namespace Tests\Conjoon\Mail\Client\Request\Message\Transformer; -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Data\Protocol\Http\Request\Transformer\DefaultMessageBodyDraftJsonTransformer; -use Conjoon\MailClient\Data\Protocol\Http\Request\Transformer\MessageBodyDraftJsonTransformer; -use Conjoon\Core\Contract\JsonDecodable; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Request\Message\Transformer\DefaultMessageBodyDraftJsonTransformer; +use Conjoon\Mail\Client\Request\Message\Transformer\MessageBodyDraftJsonTransformer; +use Conjoon\Util\JsonDecodable; use Tests\TestCase; /** - * Tests DefaultMessageBodyDraftJsonTransformer. + * Class DefaultMessageBodyDraftJsonFromArrayerTest + * @package Tests\Conjoon\Mail\Client\Request\Message\FromArrayer */ class DefaultMessageBodyDraftJsonTransformerTest extends TestCase { @@ -81,8 +81,8 @@ public function testFromArray() $this->assertSame("UTF-8", $draft->getTextPlain()->getCharset()); $this->assertSame("UTF-8", $draft->getTextHtml()->getCharset()); - $this->assertSame(MimeType::TEXT_PLAIN, $draft->getTextPlain()->getMimeType()); - $this->assertSame(MimeType::TEXT_HTML, $draft->getTextHtml()->getMimeType()); + $this->assertSame("text/plain", $draft->getTextPlain()->getMimeType()); + $this->assertSame("text/html", $draft->getTextHtml()->getMimeType()); } diff --git a/tests/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageItemDraftJsonTransformerTest.php b/tests/Mail/Client/Request/Message/Transformer/DefaultMessageItemDraftJsonTransformerTest.php similarity index 93% rename from tests/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageItemDraftJsonTransformerTest.php rename to tests/Mail/Client/Request/Message/Transformer/DefaultMessageItemDraftJsonTransformerTest.php index a1704839..097a5f2a 100644 --- a/tests/MailClient/Data/Protocol/Http/Request/Transformer/DefaultMessageItemDraftJsonTransformerTest.php +++ b/tests/Mail/Client/Request/Message/Transformer/DefaultMessageItemDraftJsonTransformerTest.php @@ -27,21 +27,22 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Protocol\Http\Request\Request\Transformer; - -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Data\Protocol\Http\Request\Transformer\DefaultMessageItemDraftJsonTransformer; -use Conjoon\MailClient\Data\Protocol\Http\Request\Transformer\MessageItemDraftJsonTransformer; -use Conjoon\Core\Contract\JsonDecodable; -use Conjoon\Core\Exception\JsonDecodeException; +namespace Tests\Conjoon\Mail\Client\Request\Message\Transformer; + +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Request\Message\Transformer\DefaultMessageItemDraftJsonTransformer; +use Conjoon\Mail\Client\Request\Message\Transformer\MessageItemDraftJsonTransformer; +use Conjoon\Util\JsonDecodable; +use Conjoon\Util\JsonDecodeException; use DateTime; use Exception; use Tests\TestCase; /** - * Tests DefaultMessageItemDraftJsonTransformer. + * Class DefaultMessageItemDraftJsonTransformerTest + * @package Tests\Conjoon\Mail\Client\Request\Message\Transformer */ class DefaultMessageItemDraftJsonTransformerTest extends TestCase { diff --git a/tests/MailClient/Service/DefaultAttachmentServiceTest.php b/tests/Mail/Client/Service/DefaultAttachmentServiceTest.php similarity index 92% rename from tests/MailClient/Service/DefaultAttachmentServiceTest.php rename to tests/Mail/Client/Service/DefaultAttachmentServiceTest.php index 238ffed1..b1852012 100644 --- a/tests/MailClient/Service/DefaultAttachmentServiceTest.php +++ b/tests/Mail/Client/Service/DefaultAttachmentServiceTest.php @@ -27,17 +27,17 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Service; - -use Conjoon\MailClient\Message\Attachment\FileAttachment; -use Conjoon\MailClient\Message\Attachment\FileAttachmentItem; -use Conjoon\MailClient\Message\Attachment\FileAttachmentList; -use Conjoon\MailClient\Message\Attachment\Processor\FileAttachmentProcessor; -use Conjoon\MailClient\Data\CompoundKey\AttachmentKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Service\AttachmentService; -use Conjoon\MailClient\Service\DefaultAttachmentService; +namespace Tests\Conjoon\Mail\Client\Service; + +use Conjoon\Mail\Client\Attachment\FileAttachment; +use Conjoon\Mail\Client\Attachment\FileAttachmentItem; +use Conjoon\Mail\Client\Attachment\FileAttachmentList; +use Conjoon\Mail\Client\Attachment\Processor\FileAttachmentProcessor; +use Conjoon\Mail\Client\Data\CompoundKey\AttachmentKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\Service\AttachmentService; +use Conjoon\Mail\Client\Service\DefaultAttachmentService; use Mockery; use Tests\TestCase; use Tests\TestTrait; diff --git a/tests/MailClient/Service/DefaultAuthServiceTest.php b/tests/Mail/Client/Service/DefaultAuthServiceTest.php similarity index 94% rename from tests/MailClient/Service/DefaultAuthServiceTest.php rename to tests/Mail/Client/Service/DefaultAuthServiceTest.php index 95c156d0..970142f2 100644 --- a/tests/MailClient/Service/DefaultAuthServiceTest.php +++ b/tests/Mail/Client/Service/DefaultAuthServiceTest.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Service; +namespace Tests\Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Data\MailAccount; -use Conjoon\MailClient\Service\DefaultAuthService; -use Conjoon\MailClient\Service\AuthService; +use Conjoon\Mail\Client\Data\MailAccount; +use Conjoon\Mail\Client\Service\DefaultAuthService; +use Conjoon\Mail\Client\Service\AuthService; use Horde_Imap_Client_Socket; use Horde_Imap_Client_Exception; use Mockery; diff --git a/tests/MailClient/Service/DefaultMailFolderServiceTest.php b/tests/Mail/Client/Service/DefaultMailFolderServiceTest.php similarity index 82% rename from tests/MailClient/Service/DefaultMailFolderServiceTest.php rename to tests/Mail/Client/Service/DefaultMailFolderServiceTest.php index 26c8608b..9829aa34 100644 --- a/tests/MailClient/Service/DefaultMailFolderServiceTest.php +++ b/tests/Mail/Client/Service/DefaultMailFolderServiceTest.php @@ -27,16 +27,14 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Service; - -use Conjoon\Data\ParameterBag; -use Conjoon\MailClient\Folder\MailFolderChildList; -use Conjoon\MailClient\Folder\MailFolderList; -use Conjoon\MailClient\Folder\Tree\MailFolderTreeBuilder; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Data\Resource\Query\MailFolderListQuery; -use Conjoon\MailClient\Service\DefaultMailFolderService; -use Conjoon\MailClient\Service\MailFolderService; +namespace Tests\Conjoon\Mail\Client\Service; + +use Conjoon\Mail\Client\Folder\MailFolderChildList; +use Conjoon\Mail\Client\Folder\MailFolderList; +use Conjoon\Mail\Client\Folder\Tree\MailFolderTreeBuilder; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\Service\DefaultMailFolderService; +use Conjoon\Mail\Client\Service\MailFolderService; use Mockery; use Tests\TestCase; use Tests\TestTrait; @@ -79,16 +77,9 @@ public function testGetMailFolderChildList() $mailFolderList = new MailFolderList(); - $query = $this->createMockForAbstract( - MailFolderListQuery::class, - [], - [new ParameterBag()] - ); - - $service->getMailClient() ->shouldReceive("getMailFolderList") - ->with($mailAccount, $query) + ->with($mailAccount) ->andReturn($mailFolderList); @@ -96,10 +87,10 @@ public function testGetMailFolderChildList() $service->getMailFolderTreeBuilder() ->shouldReceive("listToTree") - ->with($mailFolderList, ["INBOX"], $query) + ->with($mailFolderList, ["INBOX"]) ->andReturn($resultList); - $this->assertSame($resultList, $service->getMailFolderChildList($mailAccount, $query)); + $this->assertSame($resultList, $service->getMailFolderChildList($mailAccount)); } diff --git a/tests/MailClient/Service/DefaultMessageItemServiceTest.php b/tests/Mail/Client/Service/DefaultMessageItemServiceTest.php similarity index 80% rename from tests/MailClient/Service/DefaultMessageItemServiceTest.php rename to tests/Mail/Client/Service/DefaultMessageItemServiceTest.php index 50452563..92b29f64 100644 --- a/tests/MailClient/Service/DefaultMessageItemServiceTest.php +++ b/tests/Mail/Client/Service/DefaultMessageItemServiceTest.php @@ -27,40 +27,38 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Service; - -use Conjoon\Mime\MimeType; -use Conjoon\MailClient\Data\Resource\MessageBodyOptions; -use Conjoon\Data\ParameterBag; -use Conjoon\Horde_Imap\Client\HordeClient; -use Conjoon\MailClient\Data\CompoundKey\FolderKey; -use Conjoon\MailClient\Data\CompoundKey\MessageKey; -use Conjoon\MailClient\Data\MailAddress; -use Conjoon\MailClient\Data\MailAddressList; -use Conjoon\MailClient\MailClient; -use Conjoon\MailClient\Exception\MailClientException; -use Conjoon\MailClient\Message\AbstractMessageItem; -use Conjoon\MailClient\Message\Flag\FlagList; -use Conjoon\MailClient\Message\Flag\SeenFlag; -use Conjoon\MailClient\Message\MessageBody; -use Conjoon\MailClient\Message\MessageBodyDraft; -use Conjoon\MailClient\Message\MessageItem; -use Conjoon\MailClient\Message\MessageItemDraft; -use Conjoon\MailClient\Message\MessageItemList; -use Conjoon\MailClient\Message\MessagePart; -use Conjoon\MailClient\Message\Text\MessageItemFieldsProcessor; -use Conjoon\MailClient\Message\Text\PreviewTextProcessor; -use Conjoon\MailClient\Data\Resource\Query\MessageItemListQuery; -use Conjoon\MailClient\Data\Resource\Query\MessageItemQuery; -use Conjoon\MailClient\Data\Reader\DefaultPlainReadableStrategy; -use Conjoon\MailClient\Data\Reader\PurifiedHtmlStrategy; -use Conjoon\MailClient\Data\Reader\ReadableMessagePartContentProcessor; -use Conjoon\MailClient\Service\DefaultMessageItemService; -use Conjoon\MailClient\Service\MessageItemService; -use Conjoon\MailClient\Service\ServiceException; -use Conjoon\MailClient\Data\Writer\DefaultHtmlWritableStrategy; -use Conjoon\MailClient\Data\Writer\DefaultPlainWritableStrategy; -use Conjoon\MailClient\Data\Writer\WritableMessagePartContentProcessor; +namespace Tests\Conjoon\Mail\Client\Service; + +use Conjoon\Core\ParameterBag; +use Conjoon\Horde\Mail\Client\Imap\HordeClient; +use Conjoon\Mail\Client\Data\CompoundKey\FolderKey; +use Conjoon\Mail\Client\Data\CompoundKey\MessageKey; +use Conjoon\Mail\Client\Data\MailAddress; +use Conjoon\Mail\Client\Data\MailAddressList; +use Conjoon\Mail\Client\MailClient; +use Conjoon\Mail\Client\MailClientException; +use Conjoon\Mail\Client\Message\AbstractMessageItem; +use Conjoon\Mail\Client\Message\Flag\FlagList; +use Conjoon\Mail\Client\Message\Flag\SeenFlag; +use Conjoon\Mail\Client\Message\ListMessageItem; +use Conjoon\Mail\Client\Message\MessageBody; +use Conjoon\Mail\Client\Message\MessageBodyDraft; +use Conjoon\Mail\Client\Message\MessageItem; +use Conjoon\Mail\Client\Message\MessageItemDraft; +use Conjoon\Mail\Client\Message\MessageItemList; +use Conjoon\Mail\Client\Message\MessagePart; +use Conjoon\Mail\Client\Message\Text\MessageItemFieldsProcessor; +use Conjoon\Mail\Client\Message\Text\PreviewTextProcessor; +use Conjoon\Mail\Client\Query\MessageItemListResourceQuery; +use Conjoon\Mail\Client\Reader\DefaultPlainReadableStrategy; +use Conjoon\Mail\Client\Reader\PurifiedHtmlStrategy; +use Conjoon\Mail\Client\Reader\ReadableMessagePartContentProcessor; +use Conjoon\Mail\Client\Service\DefaultMessageItemService; +use Conjoon\Mail\Client\Service\MessageItemService; +use Conjoon\Mail\Client\Service\ServiceException; +use Conjoon\Mail\Client\Writer\DefaultHtmlWritableStrategy; +use Conjoon\Mail\Client\Writer\DefaultPlainWritableStrategy; +use Conjoon\Mail\Client\Writer\WritableMessagePartContentProcessor; use Conjoon\Text\CharsetConverter; use DateTime; use PHPUnit\Framework\MockObject\MockObject; @@ -135,39 +133,67 @@ public function testGetMessageItemList() $generatedTexts = []; for ($i = 0; $i < $limit; $i++) { + $text = null; + $texts = [ + "text/html" => $this->generateRandomString(is_array($html) ? $html["length"] : null), + "text/plain" => $this->generateRandomString(is_array($plain) ? $plain["length"] : null) + ]; + + + $types = ["text/html", "text/plain"]; + + $contentType = $html && $plain ? $types[$i % 2] : ($html ? $types[0] : ($plain ? $types[1] : null)); + if ($contentType) { + $text = $texts[$contentType]; + } + + $generatedTexts[] = $text ? [$contentType => $text] : []; $id = "" . ($i + 1); - $messageItemList[] = new MessageItem( + $messageItemList[] = new ListMessageItem( $this->createMessageKey(null, $mailFolderId, $id), - null + null, + $text ? new MessagePart($text, "UTF-8", $contentType) : null ); } - return $messageItemList; + return [ + "texts" => $generatedTexts, + "lists" => $messageItemList + ]; }; $input = [ - ["start" => 0, "limit" => 2], - ["start" => 0, "limit" => 2], - ["start" => 0, "limit" => 2] + ["start" => 0, "limit" => 2, "attributes" => ["html" => true, "plain" => true]], + ["start" => 0, "limit" => 2, "attributes" => ["html" => false, "plain" => false]], + ["start" => 0, "limit" => 2, "attributes" => ["html" => ["length" => 4], "plain" => ["length" => 20]]] ]; foreach ($input as $options) { - $query = $this->createMockForAbstract(MessageItemListQuery::class, [], [new ParameterBag()]); - + $query = new MessageItemListResourceQuery(new ParameterBag($options)); $service = $this->createService(); // we can work with consecutive calls, but for this test, re-creating the client // works as well $clientStub = $service->getMailClient(); - $messageItemList = $buildList($options); + list("texts" => $generatedTexts, "lists" => $messageItemList) = $buildList($options); $clientStub->method("getMessageItemList") ->with($folderKey, $query) ->willReturn($messageItemList); $results = $service->getMessageItemList($folderKey, $query); + $i = 0; foreach ($results as $resultItem) { - $this->assertInstanceOf(MessageItem::Class, $resultItem); + $this->assertInstanceOf(ListMessageItem::Class, $resultItem); + $text = !empty($generatedTexts[$i]) + ? $generatedTexts[$i][$resultItem->getMessagePart()->getMimeType()] + : null; + + $this->assertSame( + $text, + $resultItem->getMessagePart() ? $resultItem->getMessagePart()->getContents() : null + ); + $i++; } } } @@ -181,16 +207,20 @@ public function testGetMessageItemListCalls() $folderKey = new FolderKey("dev", "INBOX"); $messageKey = new MessageKey("dev", "INBOX", "123"); $messageKey2 = new MessageKey("dev", "INBOX", "1234"); - $query = $this->createMockForAbstract(MessageItemListQuery::class, [], [new ParameterBag()]); + $query = new MessageItemListResourceQuery(new ParameterBag(["attributes" => ["plain" => true]])); + + $messagePart = new MessagePart("", "", ""); + $messagePartDef = new MessagePart("", "", ""); $messageItemList = new MessageItemList(); - $messageItemList[] = new MessageItem($messageKey); - $messageItemList[] = new MessageItem($messageKey2, null); + $messageItemList[] = new ListMessageItem($messageKey); + $messageItemList[] = new ListMessageItem($messageKey2, null, $messagePartDef); $serviceMock = $this->getMockBuilder(DefaultMessageItemService::class) ->disableOriginalConstructor() ->onlyMethods([ - "charsetConvertHeaderFields" + "charsetConvertHeaderFields", + "processTextForPreview" ]) ->getMock(); @@ -203,6 +233,11 @@ public function testGetMessageItemListCalls() ->method("charsetConvertHeaderFields") ->withConsecutive([$messageItemList[0]], [$messageItemList[1]]); + $serviceMock->expects($this->exactly(2)) + ->method("processTextForPreview") + ->withConsecutive([null], [$messagePartDef]) + ->willReturn($messagePart, $messagePartDef); + $mailClientMock->expects($this->once()) ->method("getMessageItemList") ->with($folderKey, $query) @@ -217,6 +252,9 @@ public function testGetMessageItemListCalls() $messageItemList, $serviceMock->getMessageItemList($folderKey, $query) ); + + $this->assertSame($messagePart, $messageItemList[0]->getMessagePart()); + $this->assertSame($messagePartDef, $messageItemList[1]->getMessagePart()); } /** @@ -236,16 +274,17 @@ public function testGetMessageItem() $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); $messageKey = $this->createMessageKey($account->getId(), $mailFolderId, $messageItemId); - $query = $this->createMockForAbstract(MessageItemQuery::class, [], [new ParameterBag()]); + $clientStub = $service->getMailClient(); $clientStub->method("getMessageItem") - ->with($messageKey, $query) + ->with($messageKey) ->willReturn( $this->buildTestMessageItem($account->getId(), $mailFolderId, $messageItemId) ); - $item = $service->getMessageItem($messageKey, $query); + + $item = $service->getMessageItem($messageKey); $cmpItem = $this->buildTestMessageItem($account->getId(), $mailFolderId, $messageItemId); @@ -281,17 +320,16 @@ public function testGetMessageItemDraft() $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); $messageKey = $this->createMessageKey($account->getId(), $mailFolderId, $messageItemId); - $query = $this->createMockForAbstract(MessageItemQuery::class, [], [new ParameterBag()]); $clientStub = $service->getMailClient(); $clientStub->method("getMessageItemDraft") - ->with($messageKey, $query) + ->with($messageKey) ->willReturn( $this->buildTestMessageItem($account->getId(), $mailFolderId, $messageItemId, true) ); - $item = $service->getMessageItemDraft($messageKey, $query); + $item = $service->getMessageItemDraft($messageKey); $cmpItem = $this->buildTestMessageItem($account->getId(), $mailFolderId, $messageItemId, true); @@ -350,34 +388,55 @@ public function testGetMessageBodyForBoth() /** - * Tests getTotalMessageCount() and getUnreadMessageCount() + * Tests getTotalMessageCount() + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @noinspection PhpUndefinedMethodInspection */ - public function testGetTotalMessageCountAndGetUnreadMessageCount() + public function testGetTotalMessageCount() { - $folderKey = new FolderKey("a", "b"); + $service = $this->createService(); - $service = $this->getMockBuilder(DefaultMessageItemService::class) - ->disableOriginalConstructor() - ->onlyMethods(["getMailClient"]) - ->getMock(); + $mailFolderId = "INBOX"; + $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); + + $folderKey = $this->createFolderKey($account, $mailFolderId); + + $clientStub = $service->getMailClient(); + $clientStub->method("getTotalMessageCount") + ->with($folderKey) + ->willReturn( + 300 + ); + + $this->assertSame(300, $service->getTotalMessageCount($folderKey)); + } - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods(["getMessageCount"])->getMock(); - $service->expects($this->exactly(2))->method("getMailClient")->willReturn($client); + /** + * Tests getUnreadMessageCount() + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @noinspection PhpUndefinedMethodInspection + */ + public function testUnreadMessageCount() + { + $service = $this->createService(); + + $mailFolderId = "INBOX"; + $account = $this->getTestUserStub()->getMailAccount("dev_sys_conjoon_org"); - $client->expects($this->exactly(2)) - ->method("getMessageCount") + $folderKey = $this->createFolderKey($account, $mailFolderId); + + $clientStub = $service->getMailClient(); + $clientStub->method("getUnreadMessageCount") ->with($folderKey) - ->willReturn([ - "unreadMessages" => 5, - "totalMessages" => 311 - ]); + ->willReturn(311); - $this->assertSame(5, $service->getUnreadMessageCount($folderKey)); - $this->assertSame(311, $service->getTotalMessageCount($folderKey)); + $this->assertSame(311, $service->getUnreadMessageCount($folderKey)); } @@ -460,7 +519,7 @@ public function testCreateMessageBodyDraft() $clientStub->method("createMessageBodyDraft") ->with($folderKey, $messageBodyDraft) ->will($this->returnCallback($clientMockedMethod)); - $messageBodyDraft->setTextHtml(new MessagePart("a", "UTF-8", MimeType::TEXT_HTML)); + $messageBodyDraft->setTextHtml(new MessagePart("a", "UTF-8", "text/html")); $messageBody = $service->createMessageBodyDraft($folderKey, $messageBodyDraft); $this->assertSame("WRITTENtext/htmla", $messageBody->getTextHtml()->getContents()); $this->assertSame("WRITTENtext/plaina", $messageBody->getTextPlain()->getContents()); @@ -473,7 +532,7 @@ public function testCreateMessageBodyDraft() $clientStub->method("createMessageBodyDraft") ->with($folderKey, $messageBodyDraft) ->will($this->returnCallback($clientMockedMethod)); - $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", MimeType::TEXT_PLAIN)); + $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", "text/plain")); $messageBody = $service->createMessageBodyDraft($folderKey, $messageBodyDraft); $this->assertSame("WRITTENtext/htmla", $messageBody->getTextHtml()->getContents()); $this->assertSame("WRITTENtext/plaina", $messageBody->getTextPlain()->getContents()); @@ -486,8 +545,8 @@ public function testCreateMessageBodyDraft() $clientStub->method("createMessageBodyDraft") ->with($folderKey, $messageBodyDraft) ->will($this->returnCallback($clientMockedMethod)); - $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", MimeType::TEXT_PLAIN)); - $messageBodyDraft->setTextHtml(new MessagePart("b", "UTF-8", MimeType::TEXT_HTML)); + $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", "text/plain")); + $messageBodyDraft->setTextHtml(new MessagePart("b", "UTF-8", "text/html")); $messageBody = $service->createMessageBodyDraft($folderKey, $messageBodyDraft); $this->assertSame("WRITTENtext/plaina", $messageBody->getTextPlain()->getContents()); $this->assertSame("WRITTENtext/htmlb", $messageBody->getTextHtml()->getContents()); @@ -525,7 +584,7 @@ public function testCreateMessageBodyReturningNull() $clientStub = $service->getMailClient(); $messageBodyDraft = new MessageBodyDraft(); - $messageBodyDraft->setTextHtml(new MessagePart("a", "UTF-8", MimeType::TEXT_HTML)); + $messageBodyDraft->setTextHtml(new MessagePart("a", "UTF-8", "text/html")); $clientStub->method("createMessageBodyDraft") ->with($folderKey, $messageBodyDraft) @@ -535,55 +594,6 @@ public function testCreateMessageBodyReturningNull() $this->assertNull($result); } - - /** - * Tests testCreateMessageDraft with draft having key - */ - public function testCreateMessageDraftWithServiceException() - { - $folderKey = new FolderKey("a", "b"); - $messageItemDraft = new MessageItemDraft(new MessageKey($folderKey, "c")); - - $service = $this->getMockBuilder(DefaultMessageItemService::class) - ->disableOriginalConstructor() - ->onlyMethods(["getMailClient"]) - ->getMock(); - - $this->expectException(ServiceException::class); - - $service->createMessageDraft($folderKey, $messageItemDraft); - } - - /** - * Tests testCreateMessageDraft with draft having key - */ - public function testCreateMessageDraft() - { - $folderKey = new FolderKey("a", "b"); - $messageItemDraft = new MessageItemDraft(); - - $service = $this->getMockBuilder(DefaultMessageItemService::class) - ->disableOriginalConstructor() - ->onlyMethods(["getMailClient"]) - ->getMock(); - - $client = $this->getMockBuilder(HordeClient::class) - ->disableOriginalConstructor() - ->onlyMethods(["createMessageDraft"])->getMock(); - - $service->expects($this->once())->method("getMailClient")->willReturn($client); - - $createdDraft = new MessageItemDraft(); - $client->expects($this->once()) - ->method("createMessageDraft") - ->with($folderKey, $messageItemDraft) - ->willReturn($createdDraft); - - - $this->assertSame($createdDraft, $service->createMessageDraft($folderKey, $messageItemDraft)); - } - - /** * Tests updateMessageDraft() * @@ -724,7 +734,7 @@ public function testUpdateMessageBodyDraft() $clientStub->method("updateMessageBodyDraft") ->with($messageBodyDraft) ->will($this->returnCallback($clientMockedMethod)); - $messageBodyDraft->setTextHtml(new MessagePart("a", "UTF-8", MimeType::TEXT_HTML)); + $messageBodyDraft->setTextHtml(new MessagePart("a", "UTF-8", "text/html")); $messageBody = $service->updateMessageBodyDraft($messageBodyDraft); $this->assertSame("WRITTENtext/htmla", $messageBody->getTextHtml()->getContents()); $this->assertSame("WRITTENtext/plaina", $messageBody->getTextPlain()->getContents()); @@ -737,7 +747,7 @@ public function testUpdateMessageBodyDraft() $clientStub->method("updateMessageBodyDraft") ->with($messageBodyDraft) ->will($this->returnCallback($clientMockedMethod)); - $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", MimeType::TEXT_PLAIN)); + $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", "text/plain")); $messageBody = $service->updateMessageBodyDraft($messageBodyDraft); $this->assertSame("WRITTENtext/htmla", $messageBody->getTextHtml()->getContents()); $this->assertSame("WRITTENtext/plaina", $messageBody->getTextPlain()->getContents()); @@ -750,8 +760,8 @@ public function testUpdateMessageBodyDraft() $clientStub->method("updateMessageBodyDraft") ->with($messageBodyDraft) ->will($this->returnCallback($clientMockedMethod)); - $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", MimeType::TEXT_PLAIN)); - $messageBodyDraft->setTextHtml(new MessagePart("b", "UTF-8", MimeType::TEXT_HTML)); + $messageBodyDraft->setTextPlain(new MessagePart("a", "UTF-8", "text/plain")); + $messageBodyDraft->setTextHtml(new MessagePart("b", "UTF-8", "text/html")); $messageBody = $service->updateMessageBodyDraft($messageBodyDraft); $this->assertSame("WRITTENtext/plaina", $messageBody->getTextPlain()->getContents()); $this->assertSame("WRITTENtext/htmlb", $messageBody->getTextHtml()->getContents()); @@ -877,6 +887,52 @@ public function testMoveMessageException() } + /** + * Tests getListMessageItem + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * @noinspection PhpUndefinedMethodInspection + */ + public function testGetListMessageItem() + { + + $service = $this->createService(); + + $clientStub = $service->getMailClient(); + + $mailAccountId = "dev"; + $mailFolderId = "INBOX"; + $messageItemId = "1234"; + $messageKey = $this->createMessageKey($mailAccountId, $mailFolderId, $messageItemId); + $folderKey = $messageKey->getFolderKey(); + + $messageItemListMock = new MessageItemList(); + $messageItemListMock[] = new ListMessageItem( + $messageKey, + null, + new MessagePart("preview", "UTF-8", "text/html") + ); + + $clientStub->method("getMessageItemList") + ->with( + $folderKey, + $this->callback( + function ($query) use ($messageKey) { + $this->assertSame(["ids" => [$messageKey->getId()]], $query->toJson()); + return true; + } + ) + ) + ->willReturn($messageItemListMock); + + $result = $service->getListMessageItem($messageKey); + + $this->assertInstanceOf(ListMessageItem::Class, $result); + $this->assertSame("preview", $result->getMessagePart()->getContents()); + } + + /** * Tests deleteMessage() * @@ -935,37 +991,43 @@ public function testProcessTextForPreview() $method = $reflection->getMethod("processTextForPreview"); $method->setAccessible(true); - $plainMessagePartEmpty = new MessagePart("", "UTF-8", MimeType::TEXT_PLAIN); - $plainMessagePart = new MessagePart("foo", "UTF-8", MimeType::TEXT_PLAIN); - $htmlMessagePart = new MessagePart("foo", "UTF-8", MimeType::TEXT_HTML); + $plainMessagePartEmpty = new MessagePart("", "UTF-8", "text/plain"); + $plainMessagePart = new MessagePart("foo", "UTF-8", "text/plain"); + $htmlMessagePart = new MessagePart("foo", "UTF-8", "text/html"); $input = [[ - $plainMessagePart, - null + null, + new MessageItemListResourceQuery( + new ParameterBag(["attributes" => ["plain" => ["trimApi" => true, "length" => 20]]]) + ) ], [ - $plainMessagePartEmpty, - ["text/plain" => ["trimApi" => true, "length" => 20]] + $plainMessagePart, + new MessageItemListResourceQuery( + new ParameterBag(["attributes" => ["plain" => ["trimApi" => true, "length" => 20]]]) + ) ], [ $htmlMessagePart, - ["text/html" => ["trimApi" => true, "length" => 1]] + new MessageItemListResourceQuery( + new ParameterBag(["attributes" => ["html" => ["trimApi" => true, "length" => 1]]]) + ) ], [ $htmlMessagePart, - ["text/html" => ["trimApi" => true]] + new MessageItemListResourceQuery( + new ParameterBag(["attributes" => ["plain" => ["trimApi" => true, "length" => 1]]]) + ) ], [ $plainMessagePart, - ["text/plain" => ["trimApi" => false, "length" => 100]] - ], [ - // text plain configured, but message part is text/html - $htmlMessagePart, - ["text/plain" => ["trimApi" => true, "length" => 5]] + new MessageItemListResourceQuery( + new ParameterBag(["attributes" => ["plain" => ["length" => 100]]]) + ) ]]; $expectedArgs = [[ - $plainMessagePart, + $plainMessagePartEmpty, "UTF-8", - [] + ["length" => 20] ], [ - $plainMessagePartEmpty, + $plainMessagePart, "UTF-8", ["length" => 20] ], [ @@ -980,12 +1042,11 @@ public function testProcessTextForPreview() $plainMessagePart, "UTF-8", [] - ], [ - $htmlMessagePart, - "UTF-8", - [] ]]; + $this->assertNull($method->invokeArgs($service, [null, new MessageItemListResourceQuery( + new ParameterBag(["attributes" => []]) + )])); $pP->expects($this->exactly(count($input))) ->method("process") @@ -994,33 +1055,6 @@ public function testProcessTextForPreview() ); foreach ($input as $args) { - $options = $this->createMockForAbstract( - MessageBodyOptions::class, - ["getLength", "getTrimApi"], - [] - ); - - if ($args[1] === null) { - $this->assertNotNull($method->invokeArgs($service, $args)); - continue; - } - $mimeType = isset($args[1]["text/html"]) ? MimeType::TEXT_HTML : MimeType::TEXT_PLAIN; - - $opts = $args[1][$mimeType->value]; - - // delegate calls after MessagePart's mimeType and mimeType configured for tests - if (isset($opts["length"]) && $mimeType === $args[0]->getMimeType()) { - $options->expects($this->any())->method("getLength")->with($mimeType)->willReturn($opts["length"]); - } else { - $options->expects($this->any())->method("getLength")->with($args[0]->getMimeType())->willReturn(null); - } - if (isset($opts["trimApi"]) && $mimeType === $args[0]->getMimeType()) { - $options->expects($this->any())->method("getTrimApi")->with($mimeType)->willReturn($opts["trimApi"]); - } else { - $options->expects($this->any())->method("getTrimApi")->with($args[0]->getMimeType())->willReturn(null); - } - - $args[1] = $options; $this->assertNotNull($method->invokeArgs($service, $args)); } } @@ -1159,12 +1193,12 @@ protected function getMailClientMock(): MockObject "getMessageItem", "getMessageItemDraft", "getMessageBody", - "getMessageCount", + "getUnreadMessageCount", + "getTotalMessageCount", "getMailFolderList", "getFileAttachmentList", "setFlags", "createMessageBodyDraft", - "createMessageDraft", "updateMessageDraft", "updateMessageBodyDraft", "sendMessageDraft", @@ -1172,6 +1206,8 @@ protected function getMailClientMock(): MockObject "deleteMessage", "createAttachments", "deleteAttachment", + "getSupportedAttributes", + "getDefaultAttributes" ]) ->addMethods([ "getListMessageItem", @@ -1224,7 +1260,7 @@ public function process( ): MessagePart { $messagePart->setContents( "READ" . - $messagePart->getMimeType()->value . + $messagePart->getMimeType() . $messagePart->getContents(), "ISO-8859-1" ); @@ -1250,7 +1286,7 @@ public function process( ): MessagePart { $messagePart->setContents( "WRITTEN" . - $messagePart->getMimeType()->value . + $messagePart->getMimeType() . $messagePart->getContents(), "ISO-8859-1" ); @@ -1366,11 +1402,11 @@ protected function buildTestMessageBody( $mb = new MessageBody($messageKey); if ($html) { - $mb->setTextHtml(new MessagePart($html, "UTF-8", MimeType::TEXT_HTML)); + $mb->setTextHtml(new MessagePart($html, "UTF-8", "text/html")); } if ($plain) { - $mb->setTextPlain(new MessagePart($plain, "UTF-8", MimeType::TEXT_PLAIN)); + $mb->setTextPlain(new MessagePart($plain, "UTF-8", "text/plain")); } return $mb; diff --git a/tests/MailClient/Service/ServiceExceptionTest.php b/tests/Mail/Client/Service/ServiceExceptionTest.php similarity index 94% rename from tests/MailClient/Service/ServiceExceptionTest.php rename to tests/Mail/Client/Service/ServiceExceptionTest.php index 63d708cb..18ed0480 100644 --- a/tests/MailClient/Service/ServiceExceptionTest.php +++ b/tests/Mail/Client/Service/ServiceExceptionTest.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Service; +namespace Tests\Conjoon\Mail\Client\Service; -use Conjoon\MailClient\Service\ServiceException; +use Conjoon\Mail\Client\Service\ServiceException; use RuntimeException; use Tests\TestCase; diff --git a/tests/Horde_Imap/Client/SortInfoStrategyTest.php b/tests/Mail/Client/Util/JsonApiStrategyTest.php similarity index 51% rename from tests/Horde_Imap/Client/SortInfoStrategyTest.php rename to tests/Mail/Client/Util/JsonApiStrategyTest.php index c5b84a1e..f6f296ec 100644 --- a/tests/Horde_Imap/Client/SortInfoStrategyTest.php +++ b/tests/Mail/Client/Util/JsonApiStrategyTest.php @@ -27,28 +27,25 @@ declare(strict_types=1); -namespace Tests\Conjoon\Horde_Imap\Client; +namespace Tests\Conjoon\Mail\Client\Util; -use Conjoon\Core\Contract\Arrayable; -use Conjoon\Core\Contract\JsonStrategy; -use Conjoon\Data\Sort\SortDirection; -use Conjoon\Data\Sort\SortInfo; -use Conjoon\Data\Sort\SortInfoList; -use Conjoon\Horde_Imap\Client\SortInfoStrategy; -use Horde_Imap_Client; +use Conjoon\Mail\Client\Util\JsonApiStrategy; +use Conjoon\Util\Arrayable; +use Conjoon\Util\JsonStrategy; use Tests\TestCase; /** - * Tests SortInfoStrategy. + * Class JsonApiStrategyTest + * @package ests\Conjoon\Mail\Client\Util */ -class SortInfoStrategyTest extends TestCase +class JsonApiStrategyTest extends TestCase { /** * Test inheritance */ public function testClass() { - $strategy = new SortInfoStrategy(); + $strategy = new JsonApiStrategy(); $this->assertInstanceOf(JsonStrategy::class, $strategy); } @@ -58,30 +55,40 @@ public function testClass() */ public function testToJson() { - $strategy = new SortInfoStrategy(); + $strategy = new JsonApiStrategy(); - $this->assertSame([], $strategy->toJson($this->getMockForAbstractClass(Arrayable::class))); + $arrayMock = $this->getMockForAbstractClass(Arrayable::class); + $arrayMock->expects($this->exactly(1))->method("toArray")->willReturn([ + "id" => 1, + "type" => "Stub", + "mailFolderId" => 2, + "mailAccountId" => 4, + "attribute_one" => "value", + "attribute_two" => "value_2" + ]); + $this->assertEquals([ + "id" => 1, + "type" => "Stub", + "attributes" => [ + "attribute_one" => "value", + "attribute_two" => "value_2" + ], + "relationships" => [ + "MailAccounts" => [ + "data" => [ + "id" => 4, + "type" => "MailAccount" + ] + ], + "MailFolders" => [ + "data" => [ + "id" => 2, + "type" => "MailFolder" + ] + ] + ] + ], $strategy->toJson($arrayMock)); - $sortInfoList = new SortInfoList(); - $sortInfoList[] = new SortInfo("subject", SortDirection::DESC); - $sortInfoList[] = new SortInfo("date", SortDirection::ASC); - $sortInfoList[] = new SortInfo("size", SortDirection::DESC); - - $strategy = new SortInfoStrategy(); - $strategy->toJson($sortInfoList); - - $result = [ - Horde_Imap_Client::SORT_REVERSE, - Horde_Imap_Client::SORT_SUBJECT, - Horde_Imap_Client::SORT_DATE, - Horde_Imap_Client::SORT_REVERSE, - Horde_Imap_Client::SORT_SIZE - ]; - - $this->assertSame( - $result, - $strategy->toJson($sortInfoList) - ); } } diff --git a/tests/MailClient/Data/Writer/DefaultHtmlWritableStrategyTest.php b/tests/Mail/Client/Writer/DefaultHtmlWritableStrategyTest.php similarity index 87% rename from tests/MailClient/Data/Writer/DefaultHtmlWritableStrategyTest.php rename to tests/Mail/Client/Writer/DefaultHtmlWritableStrategyTest.php index b21a7601..49d1f8b3 100644 --- a/tests/MailClient/Data/Writer/DefaultHtmlWritableStrategyTest.php +++ b/tests/Mail/Client/Writer/DefaultHtmlWritableStrategyTest.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Writer; +namespace Tests\Conjoon\Mail\Client\Writer; -use Conjoon\MailClient\Message\Text\HtmlTextStrategy; -use Conjoon\MailClient\Data\Writer\DefaultHtmlWritableStrategy; -use Conjoon\MailClient\Data\Writer\HtmlWritableStrategy; +use Conjoon\Mail\Client\Message\Text\HtmlTextStrategy; +use Conjoon\Mail\Client\Writer\DefaultHtmlWritableStrategy; +use Conjoon\Mail\Client\Writer\HtmlWritableStrategy; use Tests\TestCase; /** * Class DefaultHtmlWritableStrategyTest - * @package Tests\Conjoon\MailClient\Data\Writer + * @package Tests\Conjoon\Mail\Client\Writer */ class DefaultHtmlWritableStrategyTest extends TestCase { diff --git a/tests/MailClient/Data/Writer/DefaultPlainWritableStrategyTest.php b/tests/Mail/Client/Writer/DefaultPlainWritableStrategyTest.php similarity index 88% rename from tests/MailClient/Data/Writer/DefaultPlainWritableStrategyTest.php rename to tests/Mail/Client/Writer/DefaultPlainWritableStrategyTest.php index 5c92a5d5..348442c5 100644 --- a/tests/MailClient/Data/Writer/DefaultPlainWritableStrategyTest.php +++ b/tests/Mail/Client/Writer/DefaultPlainWritableStrategyTest.php @@ -27,16 +27,16 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Writer; +namespace Tests\Conjoon\Mail\Client\Writer; -use Conjoon\MailClient\Message\Text\PlainTextStrategy; -use Conjoon\MailClient\Data\Writer\DefaultPlainWritableStrategy; -use Conjoon\MailClient\Data\Writer\PlainWritableStrategy; +use Conjoon\Mail\Client\Message\Text\PlainTextStrategy; +use Conjoon\Mail\Client\Writer\DefaultPlainWritableStrategy; +use Conjoon\Mail\Client\Writer\PlainWritableStrategy; use Tests\TestCase; /** * Class DefaultPlainWritableStrategyTest - * @package Tests\Conjoon\MailClient\Data\Writer + * @package Tests\Conjoon\Mail\Client\Writer */ class DefaultPlainWritableStrategyTest extends TestCase { diff --git a/tests/MailClient/Data/Writer/WritableMessagePartContentProcessorTest.php b/tests/Mail/Client/Writer/WritableMessagePartContentProcessorTest.php similarity index 87% rename from tests/MailClient/Data/Writer/WritableMessagePartContentProcessorTest.php rename to tests/Mail/Client/Writer/WritableMessagePartContentProcessorTest.php index 4f222aba..e08d3e7f 100644 --- a/tests/MailClient/Data/Writer/WritableMessagePartContentProcessorTest.php +++ b/tests/Mail/Client/Writer/WritableMessagePartContentProcessorTest.php @@ -27,18 +27,18 @@ declare(strict_types=1); -namespace Tests\Conjoon\MailClient\Data\Writer; +namespace Tests\Conjoon\Mail\Client\Writer; -use Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessor; -use Conjoon\MailClient\Data\Writer\HtmlWritableStrategy; -use Conjoon\MailClient\Data\Writer\PlainWritableStrategy; -use Conjoon\MailClient\Data\Writer\WritableMessagePartContentProcessor; +use Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessor; +use Conjoon\Mail\Client\Writer\HtmlWritableStrategy; +use Conjoon\Mail\Client\Writer\PlainWritableStrategy; +use Conjoon\Mail\Client\Writer\WritableMessagePartContentProcessor; use Conjoon\Text\Converter; -use Tests\Conjoon\MailClient\Message\Text\AbstractMessagePartContentProcessorTest; +use Tests\Conjoon\Mail\Client\Message\Text\AbstractMessagePartContentProcessorTest; /** * Class WritableMessagePartContentProcessorTest - * @package Tests\Conjoon\MailClient\Data\Writer + * @package Tests\Conjoon\Mail\Client\Writer */ class WritableMessagePartContentProcessorTest extends AbstractMessagePartContentProcessorTest { diff --git a/tests/MailClient/Data/CompoundKey/CompoundKeyTest.php b/tests/MailClient/Data/CompoundKey/CompoundKeyTest.php deleted file mode 100644 index 6eeffd74..00000000 --- a/tests/MailClient/Data/CompoundKey/CompoundKeyTest.php +++ /dev/null @@ -1,61 +0,0 @@ -createMockForAbstract(CompoundKey::class, [], ["a", "b"]); - $this->assertInstanceOf(Stringable::class, $key); - } - - - /** - * Tests toString() - */ - public function testToString() - { - $this->runToStringTest(CompoundKey::class); - } -} diff --git a/tests/MailClient/Data/Protocol/Http/Response/JsonApiStrategyTest.php b/tests/MailClient/Data/Protocol/Http/Response/JsonApiStrategyTest.php deleted file mode 100644 index dfbc06af..00000000 --- a/tests/MailClient/Data/Protocol/Http/Response/JsonApiStrategyTest.php +++ /dev/null @@ -1,349 +0,0 @@ -assertInstanceOf(JsonStrategy::class, $strategy); - } - - - /** - * Test toJson() - */ - public function testToJson() - { - $strategy = new JsonApiStrategy(); - - $arrayMock = $this->getMockForAbstractClass(Arrayable::class); - $arrayMock->expects($this->exactly(6))->method("toArray")->willReturnOnConsecutiveCalls( - [ - // type missing - "id" => 1, - "mailFolderId" => 2, - "mailAccountId" => 4, - "attribute_one" => "value", - "attribute_two" => "value_2" - ], - [ - "id" => 1, - "type" => "Stub", - "mailFolderId" => 2, - "mailAccountId" => 4, - "attribute_one" => "value", - "attribute_two" => "value_2" - ], - [ - "id" => 1, - "type" => "Stub", - "mailAccountId" => 4, - "attribute_one" => "value", - "attribute_two" => "value_2" - ], - [ - "id" => 1, - "type" => "Stub", - "attribute_one" => "value", - "attribute_two" => "value_2" - ], - [ - "id" => 1, - "type" => "MailFolder", - "attribute_one" => "value", - "attribute_two" => "value_2", - "data" => [[ - "id" => 2, - "type" => "MailFolder", - "field" => "value" - ],[ - "id" => 3, - "type" => "MailFolder", - "valueFor" => "field" - ]] - ], - [ - "id" => 1, - "mailFolderId" => "INBOX", - "mailAccountId" => "dev", - "type" => "MessageItem", - "previewText" => "..." - ] - ); - - $base = [ - "id" => 1, - "type" => "Stub", - "attributes" => [ - "attribute_one" => "value", - "attribute_two" => "value_2" - ] - ]; - - $results = [ - [ - // no type set - "id" => 1, - "mailFolderId" => 2, - "mailAccountId" => 4, - "attribute_one" => "value", - "attribute_two" => "value_2" - ], - array_merge($base, [ - "relationships" => [ - "MailFolder" => [ - "data" => [ - "id" => 2, - "type" => "MailFolder" - ] - ] - ] - ]), - array_merge($base, [ - "relationships" => [ - "MailAccount" => [ - "data" => [ - "id" => 4, - "type" => "MailAccount" - ] - ] - ] - - ]), - $base, - [ - "id" => 1, - "type" => "MailFolder", - "attributes" => [ - "attribute_one" => "value", - "attribute_two" => "value_2", - "data" => [ - [ - "id" => 2, - "type" => "MailFolder", - "attributes" => [ - "field" => "value" - ] - ], [ - "id" => 3, - "type" => "MailFolder", - "attributes" => [ - "valueFor" => "field" - ] - ] - ] - ] - ], - - [ - "id" => 1, - "type" => "MessageItem", - "relationships" => [ - "MailFolder" => [ - "data" => [ - "type" => "MailFolder", "id" => "INBOX" - ] - ] - ], - "attributes" => [ - "previewText" => "..." - ] - ] - - ]; - - foreach ($results as $result) { - $this->assertEquals($result, $strategy->toJson($arrayMock)); - } - } - - - /** - * Tests toJson with a Problem-object - * @return void - */ - public function testFromProblem(): void - { - $strategy = new JsonApiStrategy(); - - $problemMock = $this->getMockForAbstractClass( - AbstractProblem::class, - [], - '', - true, - true, - true, - ["toArray"] - ); - $problemMock->expects($this->exactly(3))->method("toArray")->willReturnOnConsecutiveCalls( - [ - "title" => "title", - "status" => 401, - "detail" => "detail", - "type" => "type", - "instance" => "instance" - ], - [ - "status" => 401, - "detail" => "detail", - "type" => "type" - ], - [ - "status" => 401, - "detail" => "detail", - "type" => "about:blank" - ] - ); - - - $results = [ - [ - "title" => "title", - "status" => 401, - "detail" => "detail", - "links" => [ - "about" => "type" - ], - "meta" => [ - "instance" => "instance" - ] - ], - [ - "status" => 401, - "detail" => "detail", - "links" => [ - "about" => "type" - ] - ], - [ - "status" => 401, - "detail" => "detail" - ] - ]; - - - foreach ($results as $result) { - $this->assertEquals($result, $strategy->toJson($problemMock)); - } - } - - - /** - * Tests toJson with an abstract list - * @return void - */ - public function testFromAbstractList(): void - { - $strategy = new JsonApiStrategy(); - - $list = $this->getMockForAbstractClass( - AbstractList::class, - [], - '', - true, - true, - true, - ["toJson"] - ); - $list->method("getEntityType")->willReturn(Jsonable::class); - - $len = 3; - for ($i = 0; $i < $len; $i++) { - $jsonable = $this->getMockBuilder(JsonableMock::class)->onlyMethods(["toJson"])->getMock(); - $jsonable->expects($this->once())->method("toJson")->with($strategy)->willReturn([$i]); - $list[] = $jsonable; - } - - $this->assertEquals([[0], [1], [2]], $strategy->toJson($list)); - } - - - /** - * tests fromValidationErrors - */ - public function testFromValidationErrors() - { - $strategy = new JsonApiStrategy(); - - $validationErrors = new ValidationErrors(); - - $error = $this->createMockForAbstract( - ValidationError::class, - ["toArray"], - [new stdClass(), "details", -1] - ); - $error->expects($this->once())->method("toArray")->willReturn([ - "fakeError" => "" - ]); - - $validationErrors[] = $error; - - $result = $validationErrors->toJson($strategy); - - $this->assertEquals(["errors" => [[ - "fakeError" => "" - ]]], $result); - } -} - -/** - * TestClass - */ -class JsonableMock implements Jsonable, Arrayable -{ - public function toJson(JsonStrategy $strategy = null): array - { - return []; - } - - public function toArray(): array - { - return []; - } -} diff --git a/tests/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategyTest.php b/tests/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategyTest.php deleted file mode 100644 index 2c6cf26c..00000000 --- a/tests/MailClient/Data/Protocol/Imap/Search/SearchQueryStrategyTest.php +++ /dev/null @@ -1,120 +0,0 @@ -assertInstanceOf(StringStrategy::class, $strategy); - } - - /** - * Tests getSearchQueryFromFilter - */ - public function testToString() - { - $strategy = new SearchQueryStrategy(); - - - $tests = [ - [ - "input" => new Filter( - LogicalExpression::OR( - RelationalExpression::EQ( - VariableName::make("RECENT"), - Value::make(true) - ), - RelationalExpression::GE( - VariableName::make("UID"), - Value::make(1000) - ) - ) - ), - "output" => "OR (RECENT) (UID 1000:*)" - ], [ - "input" => new Filter( - RelationalExpression::EQ( - VariableName::make("RECENT"), - Value::make(true) - ) - ), - "output" => "(RECENT)" - ], [ - "input" => new Filter( - RelationalExpression::GE( - VariableName::make("UID"), - Value::make(1000) - ) - ), - "output" => "(UID 1000:*)" - ], [ - "input" => new Filter( - LogicalExpression::OR( - RelationalExpression::EQ( - VariableName::make("RECENT"), - Value::make(true) - ), - FunctionalExpression::IN( - VariableName::make("UID"), - Value::make(1000), - Value::make(1001) - ) - ) - ), - "output" => "OR (RECENT) (UID 1000:1001)" - ] - ]; - - - foreach ($tests as $test) { - $filter = $test["input"]; - - $this->assertSame( - $test["output"], - $strategy->toString($filter) - ); - } - } -} diff --git a/tests/MailClient/Data/Resource/MailAccountTest.php b/tests/MailClient/Data/Resource/MailAccountTest.php deleted file mode 100644 index 445243ad..00000000 --- a/tests/MailClient/Data/Resource/MailAccountTest.php +++ /dev/null @@ -1,135 +0,0 @@ -assertInstanceOf(ObjectDescription::class, $inst); - } - - - /** - * @return string - */ - public function testGetType(): void - { - $this->assertSame("MailAccount", $this->createDescription()->getType()); - } - - - /** - * Tests getRelationships() - */ - public function testGetRelationships(): void - { - $list = $this->createDescription()->getRelationships(); - $this->assertSame(0, count($list)); - - $this->assertSame( - ["MailAccount"], - $this->createDescription()->getAllRelationshipPaths(true) - ); - - $this->assertEqualsCanonicalizing( - ["MailAccount"], - $this->createDescription()->getAllRelationshipTypes(true) - ); - } - - - /** - * Tests getFields() - */ - public function testGetFields(): void - { - $this->assertEquals([ - "name", - "folderType", - "from", - "replyTo", - "inbox_address", - "inbox_port", - "inbox_user", - "inbox_password", - "inbox_ssl", - "outbox_address", - "outbox_port", - "outbox_user", - "outbox_password", - "outbox_secure" - ], $this->createDescription()->getFields()); - } - - - /** - * tests getDefaultFields() - */ - public function testGetDefaultFields(): void - { - $this->assertEquals([ - "name", - "folderType", - "from", - "replyTo", - "inbox_address", - "inbox_port", - "inbox_user", - "inbox_password", - "inbox_ssl", - "outbox_address", - "outbox_port", - "outbox_user", - "outbox_password", - "outbox_secure" - ], $this->createDescription()->getDefaultFields()); - } - - - /** - * @return MailAccount - */ - protected function createDescription(): MailAccount - { - return new MailAccount(); - } -} diff --git a/tests/MailClient/Data/Resource/MailFolderTest.php b/tests/MailClient/Data/Resource/MailFolderTest.php deleted file mode 100644 index 6cf40d66..00000000 --- a/tests/MailClient/Data/Resource/MailFolderTest.php +++ /dev/null @@ -1,120 +0,0 @@ -assertInstanceOf(ObjectDescription::class, $inst); - } - - - /** - * @return string - */ - public function testGetType(): void - { - $this->assertSame("MailFolder", $this->createDescription()->getType()); - } - - - /** - * Tests getRelationships() - */ - public function testGetRelationships(): void - { - $list = $this->createDescription()->getRelationships(); - $this->assertSame(1, count($list)); - - $this->assertInstanceOf(MailAccount::class, $list[0]); - - $this->assertSame( - ["MailFolder", "MailFolder.MailAccount"], - $this->createDescription()->getAllRelationshipPaths(true) - ); - - $this->assertEqualsCanonicalizing( - ["MailFolder", "MailAccount"], - $this->createDescription()->getAllRelationshipTypes(true) - ); - } - - - /** - * Tests getFields() - */ - public function testGetFields(): void - { - $this->assertEquals([ - "name", - "data", - "folderType", - "unreadMessages", - "totalMessages" - ], $this->createDescription()->getFields()); - } - - - /** - * tests getDefaultFields() - */ - public function testGetDefaultFields(): void - { - $this->assertEquals([ - "name", - "data", - "folderType", - "unreadMessages", - "totalMessages" - ], $this->createDescription()->getDefaultFields()); - } - - - /** - * @return MailFolder - */ - protected function createDescription(): MailFolder - { - return new MailFolder(); - } -} diff --git a/tests/MailClient/Data/Resource/MessageBodyTest.php b/tests/MailClient/Data/Resource/MessageBodyTest.php deleted file mode 100644 index d58d00b1..00000000 --- a/tests/MailClient/Data/Resource/MessageBodyTest.php +++ /dev/null @@ -1,116 +0,0 @@ -assertInstanceOf(ObjectDescription::class, $inst); - } - - - /** - * @return void - */ - public function testGetType(): void - { - $this->assertSame("MessageBody", $this->createDescription()->getType()); - } - - - /** - * Tests getRelationships() - */ - public function testGetRelationships(): void - { - $list = $this->createDescription()->getRelationships(); - $this->assertSame(2, count($list)); - - $this->assertInstanceOf(MailFolder::class, $list[0]); - $this->assertInstanceOf(MessageItem::class, $list[1]); - - $this->assertSame( - ["MessageBody", "MessageBody.MailFolder", "MessageBody.MailFolder.MailAccount", "MessageBody.MessageItem"], - $this->createDescription()->getAllRelationshipPaths(true) - ); - - $this->assertEqualsCanonicalizing( - ["MessageItem", "MailFolder", "MessageBody", "MailAccount"], - $this->createDescription()->getAllRelationshipTypes(true) - ); - } - - - /** - * Tests getFields() - */ - public function testGetFields(): void - { - $this->assertEqualsCanonicalizing([ - "textPlain", - "textHtml" - ], $this->createDescription()->getFields()); - } - - - /** - * tests getDefaultFields() - */ - public function testGetDefaultFields(): void - { - $this->assertEquals([ - "textPlain", - "textHtml" - ], $this->createDescription()->getDefaultFields()); - } - - - /** - * @return MessageBody - */ - protected function createDescription(): MessageBody - { - return new MessageBody(); - } -} diff --git a/tests/MailClient/Data/Resource/MessageItemTest.php b/tests/MailClient/Data/Resource/MessageItemTest.php deleted file mode 100644 index 1267acfb..00000000 --- a/tests/MailClient/Data/Resource/MessageItemTest.php +++ /dev/null @@ -1,144 +0,0 @@ -assertInstanceOf(ObjectDescription::class, $inst); - } - - - /** - * @return void - */ - public function testGetType(): void - { - $this->assertSame("MessageItem", $this->createDescription()->getType()); - } - - - /** - * Tests getRelationships() - */ - public function testGetRelationships(): void - { - $list = $this->createDescription()->getRelationships(); - $this->assertSame(2, count($list)); - - $this->assertInstanceOf(MailFolder::class, $list[0]); - $this->assertInstanceOf(MessageBody::class, $list[1]); - - $this->assertSame( - ["MessageItem", "MessageItem.MailFolder", "MessageItem.MailFolder.MailAccount", "MessageItem.MessageBody"], - $this->createDescription()->getAllRelationshipPaths(true) - ); - - $this->assertEqualsCanonicalizing( - ["MessageItem", "MailFolder", "MessageBody", "MailAccount"], - $this->createDescription()->getAllRelationshipTypes(true) - ); - } - - - /** - * Tests getFields() - */ - public function testGetFields(): void - { - $this->assertEqualsCanonicalizing([ - "from", - "to", - "subject", - "date", - "seen", - "answered", - "draft", - "flagged", - "recent", - "charset", - "references", - "messageId", - "size", - "hasAttachments", - "cc", - "bcc", - "replyTo", - "draftInfo" - ], $this->createDescription()->getFields()); - } - - - /** - * tests getDefaultFields() - */ - public function testGetDefaultFields(): void - { - $this->assertEqualsCanonicalizing([ - "from", - "to", - "subject", - "date", - "seen", - "answered", - "draft", - "flagged", - "recent", - "charset", - "references", - "messageId", - "size", - "hasAttachments" - ], $this->createDescription()->getDefaultFields()); - } - - - /** - * @return MessageItem - */ - protected function createDescription(): MessageItem - { - return new MessageItem(); - } -} diff --git a/tests/MailClient/Data/Resource/Query/MailFolderListQueryTest.php b/tests/MailClient/Data/Resource/Query/MailFolderListQueryTest.php deleted file mode 100644 index a229447e..00000000 --- a/tests/MailClient/Data/Resource/Query/MailFolderListQueryTest.php +++ /dev/null @@ -1,52 +0,0 @@ -createMockForAbstract(MailFolderListQuery::class, [], [new ParameterBag()]); - - $this->assertInstanceOf(MailFolder::class, $inst->getResourceTarget( - )); - } -} diff --git a/tests/MailClient/Data/Resource/Query/MessageBodyQueryTest.php b/tests/MailClient/Data/Resource/Query/MessageBodyQueryTest.php deleted file mode 100644 index a16e2ac7..00000000 --- a/tests/MailClient/Data/Resource/Query/MessageBodyQueryTest.php +++ /dev/null @@ -1,54 +0,0 @@ -createMockForAbstract(MessageBodyQuery::class, [], [new ParameterBag()]); - $this->assertInstanceOf(ResourceQuery::class, $inst); - - $this->assertInstanceOf(MessageBody::class, $inst->getResourceTarget( - )); - } -} diff --git a/tests/MailClient/Data/Resource/Query/MessageItemListQueryTest.php b/tests/MailClient/Data/Resource/Query/MessageItemListQueryTest.php deleted file mode 100644 index 4f5076f8..00000000 --- a/tests/MailClient/Data/Resource/Query/MessageItemListQueryTest.php +++ /dev/null @@ -1,53 +0,0 @@ -createMockForAbstract(MessageItemListQuery::class, [], [new ParameterBag()]); - $this->assertInstanceOf(ResourceQuery::class, $inst); - - $this->assertInstanceOf(MessageItem::class, $inst->getResourceTarget()); - } -} diff --git a/tests/MailClient/Exception/MailFolderNotFoundExceptionTest.php b/tests/MailClient/Exception/MailFolderNotFoundExceptionTest.php deleted file mode 100644 index 462ed6ea..00000000 --- a/tests/MailClient/Exception/MailFolderNotFoundExceptionTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertInstanceOf(ResourceNotFoundException::class, $exception); - } -} diff --git a/tests/MailClient/Exception/MessageNotFoundExceptionTest.php b/tests/MailClient/Exception/MessageNotFoundExceptionTest.php deleted file mode 100644 index 586eb3e6..00000000 --- a/tests/MailClient/Exception/MessageNotFoundExceptionTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertInstanceOf(ResourceNotFoundException::class, $exception); - } -} diff --git a/tests/MailClient/Exception/ResourceNotFoundExceptionTest.php b/tests/MailClient/Exception/ResourceNotFoundExceptionTest.php deleted file mode 100644 index 229058dc..00000000 --- a/tests/MailClient/Exception/ResourceNotFoundExceptionTest.php +++ /dev/null @@ -1,49 +0,0 @@ -getMockForAbstractClass(ResourceNotFoundException::class); - - $this->assertInstanceOf(MailClientException::class, $exception); - } -} diff --git a/tests/MailClient/Folder/MailFolderTest.php b/tests/MailClient/Folder/MailFolderTest.php deleted file mode 100644 index 54f66826..00000000 --- a/tests/MailClient/Folder/MailFolderTest.php +++ /dev/null @@ -1,318 +0,0 @@ -createKey(); - - $this->assertTrue(MailFolder::TYPE_INBOX != ""); - $this->assertTrue(MailFolder::TYPE_DRAFT != ""); - $this->assertTrue(MailFolder::TYPE_JUNK != ""); - $this->assertTrue(MailFolder::TYPE_TRASH != ""); - $this->assertTrue(MailFolder::TYPE_SENT != ""); - $this->assertTrue(MailFolder::TYPE_FOLDER != ""); - - $mailFolder = new MailFolder( - $folderKey, - [ - "name" => "Folder", - "unreadMessages" => 0, - "totalMessages" => 0, - "folderType" => MailFolder::TYPE_INBOX - ] - ); - - $this->assertInstanceOf(AbstractMailFolder::class, $mailFolder); - $this->assertSame(MailFolder::TYPE_INBOX, $mailFolder->getFolderType()); - - - $children = $mailFolder->getData(); - $this->assertInstanceOf(MailFolderChildList::class, $mailFolder->getData()); - $this->assertSame(0, count($children)); - - - $mf = new MailFolder($this->createKey(), [ - "name" => "Folder2", - "unreadMessages" => 32, - "totalMessages" => 45, - "folderType" => MailFolder::TYPE_INBOX - ]); - $ret = $mailFolder->addMailFolder($mf); - - $this->assertSame($mf, $ret); - - $this->assertSame(1, count($children)); - $this->assertSame($mf, $children[0]); - } - - - /** - * Tests constructor with exception for missing folderType never thrown - */ - public function testConstructorExceptionFolderTypeNeverThrown() - { - - $folderKey = $this->createKey(); - $folder = new MailFolder( - $folderKey, - [ - ] - ); - - $this->assertNull($folder->getFolderType()); - } - - - /** - * Test for exception if invalid folder type gets submitted to setFolderType - */ - public function testSetFolderTypeException() - { - $this->expectException(InvalidArgumentException::class); - - new MailFolder($this->createKey(), ["folderType" => "foo"]); - } - - - /** - * Test for toArray - */ - public function testToArray() - { - - $data = [ - "unreadMessages" => 5, - "totalMessages" => 8 - ]; - - $key = $this->createKey("dev", "INBOX"); - - $mf = new MailFolder($key, $data); - - $mf->addMailFolder( - new MailFolder( - $this->createKey("dev", "INBOX.SubFolder"), - [ - "name" => "A", - "unreadMessages" => 4, - "totalMessages" => 2, - "folderType" => MailFolder::TYPE_INBOX - ] - ) - ); - - $json = $mf->toJson(); - - $expected = array_merge($key->toArray(), $data, ["type" => "MailFolder"]); - $expected["data"] = [[ - "mailAccountId" => "dev", - "type" => "MailFolder", - "id" => "INBOX.SubFolder", - "name" => "A", - "unreadMessages" => 4, - "totalMessages" => 2, - "folderType" => MailFolder::TYPE_INBOX, - "data" => [] - ]]; - - - $this->assertEquals($expected, $json); - } - - - /** - * Test for toJson - */ - public function testToJson() - { - $strategy = new JsonApiStrategy(); - - $data = [ - "folderType" => MailFolder::TYPE_INBOX, - "name" => "INBOX", - "unreadMessages" => 5, - "totalMessages" => 400 - ]; - - $key = $this->createKey("dev", "INBOX"); - - $mf = new MailFolder($key, $data); - - $mf->addMailFolder( - new MailFolder( - $this->createKey("dev", "INBOX.SubFolder"), - [ - "name" => "A", - "unreadMessages" => 4, - "totalMessages" => 23, - "folderType" => MailFolder::TYPE_INBOX - ] - ) - )->addMailFolder( - new MailFolder( - $this->createKey("dev", "INBOX.SubFolder.last week"), - [ - "name" => "last week", - "unreadMessages" => 0, - "totalMessages" => 0, - "folderType" => MailFolder::TYPE_INBOX - ] - ) - ); - - $json = $mf->toJson($strategy); - - $relationships = [ - "MailAccount" => [ - "data" => [ - "id" => "dev", - "type" => "MailAccount" - ] - ] - ]; - - $expected = [ - "id" => $key->getId(), - "type" => "MailFolder", - "attributes" => $data, - "relationships" => $relationships - ]; - - $expected["attributes"]["data"] = [[ - "id" => "INBOX.SubFolder", - "type" => "MailFolder", - "attributes" => [ - "name" => "A", - "unreadMessages" => 4, - "totalMessages" => 23, - "folderType" => MailFolder::TYPE_INBOX, - "data" => [[ - - "id" => "INBOX.SubFolder.last week", - "type" => "MailFolder", - "attributes" => [ - "name" => "last week", - "unreadMessages" => 0, - "totalMessages" => 0, - "folderType" => MailFolder::TYPE_INBOX, - "data" => [] - ], - "relationships" => [ - "MailAccount" => [ - "data" => [ - "id" => "dev", - "type" => "MailAccount" - ] - ] - ] - - ]] - ], - "relationships" => [ - "MailAccount" => [ - "data" => [ - "id" => "dev", - "type" => "MailAccount" - ] - ] - ] - ]]; - - - $this->assertEquals($expected, $json); - } - - - /** - * Tests behavior of MailFolder with data - */ - public function testData() - { - $key = $this->createKey("dev", "INBOX"); - - $addFolder = new MailFolder(new FolderKey("dev", "INBOX.Drafts"), []); - - $make = fn ($data) => new MailFolder($key, $data); - - $this->assertInstanceOf(MailFolderChildList::class, $make([])->getData()); - - $mf = $make(["data" => $addFolder]); - $this->assertInstanceOf(MailFolderChildList::class, $mf->getData()); - $this->assertSame($addFolder, $mf->getData()[0]); - $this->assertArrayHasKey("data", $mf->toArray()); - - $mf = $make(["data" => null]); - $this->assertNull($mf->getData()); - $this->assertArrayNotHasKey("data", $mf->toArray()); - - $mf = $make([]); - $mf->setData(null); - $this->assertNull($mf->getData()); - $this->assertArrayNotHasKey("data", $mf->toArray()); - } - - -// --------------------- -// Helper -// --------------------- - - - /** - * @return FolderKey - */ - public function createKey($account = "dev", $name = "INBOX.Some Folder") - { - - return new FolderKey($account, $name); - } -} diff --git a/tests/Math/Expression/ExpressionListTest.php b/tests/Math/Expression/ExpressionListTest.php deleted file mode 100644 index cb23810a..00000000 --- a/tests/Math/Expression/ExpressionListTest.php +++ /dev/null @@ -1,93 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - - $this->assertSame(Expression::class, $list->getEntityType()); - } - - - /** - * Tests to array - */ - public function testToArray() - { - $list = $this->createList(); - - $entry1 = $this->createMockForAbstract( - Expression::class, - ["toArray"] - ); - $entry1->expects($this->once())->method("toArray")->willReturn(["entry1"]); - $entry2 = $this->createMockForAbstract( - Expression::class, - ["toArray"] - ); - $entry2->expects($this->once())->method("toArray")->willReturn(["entry2"]); - - $list[] = $entry1; - $list[] = $entry2; - - $this->assertEquals([ - ["entry1"], ["entry2"] - ], $list->toArray()); - } - - - /** - * @return ExpressionList - */ - protected function createList(): ExpressionList - { - return new ExpressionList(); - } -} diff --git a/tests/Math/Expression/ExpressionTest.php b/tests/Math/Expression/ExpressionTest.php deleted file mode 100644 index 13964d2c..00000000 --- a/tests/Math/Expression/ExpressionTest.php +++ /dev/null @@ -1,134 +0,0 @@ -createMockForAbstract(Expression::class); - $this->assertInstanceOf(Stringable::class, $expression); - $this->assertInstanceOf(Arrayable::class, $expression); - - $operands = $this->makeAccessible($expression, "operands", true); - $list = new OperandList(); - $operands->setValue($expression, $list); - - $operator = $this->makeAccessible($expression, "operator", true); - $value = $this->createMockForAbstract(Operator::class); - $operator->setValue($expression, $value); - - - $this->assertSame($value, $expression->getOperator()); - } - - /** - * @return void - */ - public function testToStringAndToArray(): void - { - $operator = $this->createMockForAbstract(Operator::class, ["toString"]); - $operand1 = $this->createMockForAbstract(Operand::class, ["toArray"]); - $operand2 = $this->createMockForAbstract(Operand::class, ["toArray"]); - - $operator->expects($this->any())->method("toString")->willReturn("+"); - $operand1->expects($this->any())->method("toString")->willReturn("A"); - $operand2->expects($this->any())->method("toString")->willReturn("B"); - $operandList = OperandList::make($operand1, $operand2); - - $expression = $this->createMockForAbstract(Expression::class, ["getOperator", "getOperands"]); - $expression->expects($this->exactly(2))->method("getOperator")->willReturn($operator); - $expression->expects($this->exactly(2))->method("getOperands")->willReturn($operandList); - - $this->assertSame("(A+B)", $expression->toString()); - $this->assertSame(["+", "A", "B"], $expression->toArray()); - - $operandList = OperandList::make($operand1); - $expression = $this->createMockForAbstract(Expression::class, ["getOperator", "getOperands"]); - $expression->expects($this->exactly(1))->method("getOperator")->willReturn($operator); - $expression->expects($this->exactly(1))->method("getOperands")->willReturn($operandList); - $this->assertSame("(+A)", $expression->toString()); - - $this->runToStringTest(Expression::class); - } - - - /** - * @return void - */ - public function testToJson(): void - { - $expression = $this->createMockForAbstract(Expression::class, ["getOperands", "getOperator"]); - - $expression->expects($this->any())->method("getOperands")->willReturn(new OperandList()); - $expression->expects($this->any())->method("getOperator")->willReturn( - $this->createMockForAbstract(Operator::class) - ); - - $this->runToJsonTest($expression); - } - - - /** - * tests getValue() - * @return void - */ - public function testGetValue(): void - { - $this->expectException(InvalidOperationException::class); - - $expression = $this->createMockForAbstract(Expression::class); - $expression->getValue(); - } -} diff --git a/tests/Math/Expression/FunctionalExpressionTest.php b/tests/Math/Expression/FunctionalExpressionTest.php deleted file mode 100644 index f105f8f8..00000000 --- a/tests/Math/Expression/FunctionalExpressionTest.php +++ /dev/null @@ -1,113 +0,0 @@ -assertContains(OperatorCallTrait::class, $uses); - - $this->assertSame(FunctionalOperator::class, FunctionalExpression::getOperatorClass()); - - $operator = FunctionalOperator::IN; - - $lftOperand = $this->createMockForAbstract(Operand::class); - $rtOperand = $this->createMockForAbstract(Operand::class); - - $expression = new FunctionalExpression( - $operator, - OperandList::make($lftOperand, $rtOperand) - ); - - $this->assertInstanceOf(Expression::class, $expression); - - $this->assertSame($lftOperand, $expression->getOperands()[0]); - $this->assertSame($rtOperand, $expression->getOperands()[1]); - } - - - /** - * Tests constructor with InvalidOperandException - */ - public function testConstructorWithInvalidOperandException() - { - $this->expectException(InvalidOperandException::class); - $this->expectExceptionMessage("expects at least 2 operands"); - - $operator = FunctionalOperator::IN; - new FunctionalExpression( - $operator, - new OperandList() - ); - } - - /** - * Tests toString() - */ - public function testToString() - { - $operator = FunctionalOperator::IN; - $operands = OperandList::make( - VariableName::make("seen"), - Value::make(1), - Value::make(2), - Value::make(3), - ); - $expression = new FunctionalExpression( - $operator, - $operands - ); - - $this->assertSame("(seen IN (1, 2, 3))", $expression->toString()); - } -} diff --git a/tests/Math/Expression/LogicalExpressionTest.php b/tests/Math/Expression/LogicalExpressionTest.php deleted file mode 100644 index 8b20c4ef..00000000 --- a/tests/Math/Expression/LogicalExpressionTest.php +++ /dev/null @@ -1,165 +0,0 @@ -assertContains(OperatorCallTrait::class, $uses); - - $this->assertSame(LogicalOperator::class, LogicalExpression::getOperatorClass()); - - $operator = LogicalOperator::AND; - - $operands = [ - $this->createMockForAbstract(Operand::class), - $this->createMockForAbstract(Operand::class), - $this->createMockForAbstract(Operand::class) - ]; - - $expression = new LogicalExpression( - $operator, - OperandList::make(...$operands) - ); - - $this->assertInstanceOf(Expression::class, $expression); - - foreach ($operands as $index => $ops) { - $this->assertSame($ops, $expression->getOperands()[$index]); - } - } - - - /** - * Tests constructor with AND andInvalidOperandException - */ - public function testConstructorWithAndOperatorInvalidOperandException() - { - $this->expectException(InvalidOperandException::class); - $this->expectExceptionMessage("expects at least 2 operands"); - - $operator = LogicalOperator::AND; - new LogicalExpression( - $operator, - new OperandList() - ); - } - - - /** - * Tests constructor with NOT and InvalidOperandException - */ - public function testConstructorWithNegationOperatorInvalidOperandException() - { - $this->expectException(InvalidOperandException::class); - $this->expectExceptionMessage("expects 1 operand"); - - $operands = OperandList::make( - $this->createMockForAbstract(Operand::class), - $this->createMockForAbstract(Operand::class) - ); - $operator = LogicalOperator::NOT; - new LogicalExpression( - $operator, - $operands - ); - } - - - /** - * Tests constructor with OR operator and InvalidOperandException - */ - public function testConstructorWithOrOperatorInvalidOperandException() - { - $this->expectException(InvalidOperandException::class); - $this->expectExceptionMessage("expects at least 2 operands"); - - $operator = LogicalOperator::OR; - new LogicalExpression( - $operator, - new OperandList() - ); - } - - /** - * Tests toString() - */ - public function testToString() - { - $operator = LogicalOperator::AND; - $expression = new LogicalExpression( - $operator, - OperandList::make( - new Value(1), - new Value(2) - ) - ); - - $this->assertSame("(1&&2)", $expression->toString()); - - $operator = LogicalOperator::OR; - $lftOp = LogicalOperator::AND; - $rtOp = LogicalOperator::NOT; - - $notExpression = new LogicalExpression($rtOp, OperandList::make(new VariableName("a"))); - - $expression = new LogicalExpression( - $operator, - OperandList::make( - new LogicalExpression($lftOp, OperandList::make(new VariableName("x"), new VariableName("y"))), - $notExpression - ) - ); - - $this->assertSame( - "((x&&y)||(!a))", - $expression->toString() - ); - } -} diff --git a/tests/Math/Expression/Notation/PolishNotationTest.php b/tests/Math/Expression/Notation/PolishNotationTest.php deleted file mode 100644 index 6005a557..00000000 --- a/tests/Math/Expression/Notation/PolishNotationTest.php +++ /dev/null @@ -1,124 +0,0 @@ -assertInstanceOf(StringStrategy::class, $pn); - } - - - /** - * Tests toString() with UnexpectedTypeException - */ - public function testToStringWithUnexpectedTypeException() - { - $this->expectException(UnexpectedTypeException::class); - $this->expectExceptionMessage(Expression::class); - - $pn = new PolishNotation(); - - $testClass = new class implements Stringable { - public function toString(StringStrategy $stringStrategy = null): string - { - return $stringStrategy->toString($this); - } - }; - - $testClass->toString($pn); - } - - /** - * Tests constructor with InvalidOperandException - */ - public function testToString() - { - $operator = RelationalOperator::EQ; - $expression = new RelationalExpression( - $operator, - OperandList::make( - new Value(1), - new Value(2) - ) - ); - - $this->assertSame("== 1 2", $expression->toString(new PolishNotation())); - - $operator = RelationalOperator::LE; - $lftOp = RelationalOperator::NE; - $rtOp = RelationalOperator::GT; - - $expression = new RelationalExpression( - $operator, - OperandList::make( - new RelationalExpression($lftOp, OperandList::make(new VariableName("x"), new VariableName("y"))), - new RelationalExpression($rtOp, OperandList::make(new VariableName("a"), new VariableName("b"))) - ) - ); - - $this->assertSame( - "((x!=y)<=(a>b))", - $expression->toString() - ); - - $this->assertSame( - "<= != x y > a b", - $expression->toString(new PolishNotation()) - ); - } -} diff --git a/tests/Math/Expression/Operator/FunctionalOperatorTest.php b/tests/Math/Expression/Operator/FunctionalOperatorTest.php deleted file mode 100644 index 301f18d6..00000000 --- a/tests/Math/Expression/Operator/FunctionalOperatorTest.php +++ /dev/null @@ -1,68 +0,0 @@ -assertContains(OperatorStringableTrait::class, $uses); - - $class = new ReflectionClass(FunctionalOperator::class); - $this->assertTrue($class->implementsInterface(Operator::class)); - - - $this->assertEqualsCanonicalizing( - [ - FunctionalOperator::IN - ], - FunctionalOperator::cases() - ); - - $this->assertSame("IN", FunctionalOperator::IN->value); - } -} diff --git a/tests/Math/Expression/Operator/LogicalOperatorTest.php b/tests/Math/Expression/Operator/LogicalOperatorTest.php deleted file mode 100644 index 28cebcd5..00000000 --- a/tests/Math/Expression/Operator/LogicalOperatorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -assertContains(OperatorStringableTrait::class, $uses); - - $class = new ReflectionClass(LogicalOperator::class); - $this->assertTrue($class->implementsInterface(Operator::class)); - - - $this->assertEqualsCanonicalizing( - [ - LogicalOperator::AND, - LogicalOperator::OR, - LogicalOperator::NOT - ], - LogicalOperator::cases() - ); - - $this->assertSame("&&", LogicalOperator::AND->value); - $this->assertSame("||", LogicalOperator::OR->value); - $this->assertSame("!", LogicalOperator::NOT->value); - } -} diff --git a/tests/Math/Expression/Operator/OperatorStringableTraitTest.php b/tests/Math/Expression/Operator/OperatorStringableTraitTest.php deleted file mode 100644 index 37a9f09b..00000000 --- a/tests/Math/Expression/Operator/OperatorStringableTraitTest.php +++ /dev/null @@ -1,66 +0,0 @@ -getMockedTrait(); - - $trait->value = "someValue"; - - $this->assertSame("someValue", $trait->toString()); - - $strategyStub = $this->createMockForAbstract(StringStrategy::class, ["toString"]); - $strategyStub->expects($this->once())->method("toString")->with($trait)->willReturn("CALLED"); - $this->assertSame("CALLED", $trait->toString($strategyStub)); - } - - - - public function getMockedTrait() - { - return new class implements Stringable { - use OperatorStringableTrait; - }; - } -} diff --git a/tests/Math/Expression/Operator/OperatorTest.php b/tests/Math/Expression/Operator/OperatorTest.php deleted file mode 100644 index 71e52882..00000000 --- a/tests/Math/Expression/Operator/OperatorTest.php +++ /dev/null @@ -1,54 +0,0 @@ -createMockForAbstract(Operator::class); - $this->assertInstanceOf(Stringable::class, $operator); - } -} diff --git a/tests/Math/Expression/Operator/RelationalOperatorTest.php b/tests/Math/Expression/Operator/RelationalOperatorTest.php deleted file mode 100644 index 1e4edf9c..00000000 --- a/tests/Math/Expression/Operator/RelationalOperatorTest.php +++ /dev/null @@ -1,83 +0,0 @@ -assertContains(OperatorStringableTrait::class, $uses); - - $class = new ReflectionClass(RelationalOperator::class); - $this->assertTrue($class->implementsInterface(Operator::class)); - - - $this->assertEqualsCanonicalizing( - [ - RelationalOperator::EQ, - RelationalOperator::NE, - RelationalOperator::GT, - RelationalOperator::LT, - RelationalOperator::LE, - RelationalOperator::GE, - ], - RelationalOperator::cases() - ); - - $this->assertSame("==", RelationalOperator::EQ->value); - - $this->assertSame("!=", RelationalOperator::NE->value); - - $this->assertSame(">", RelationalOperator::GT->value); - - $this->assertSame("<", RelationalOperator::LT->value); - - $this->assertSame(">=", RelationalOperator::GE->value); - - $this->assertSame("<=", RelationalOperator::LE->value); - } -} diff --git a/tests/Math/Expression/OperatorCallTraitTest.php b/tests/Math/Expression/OperatorCallTraitTest.php deleted file mode 100644 index 65e8b649..00000000 --- a/tests/Math/Expression/OperatorCallTraitTest.php +++ /dev/null @@ -1,98 +0,0 @@ -assertInstanceOf(TestClass::class, $result); - $this->assertSame($result->enum, TestEnum::EXAMPLE); - $this->assertSame($lft, $result->operands[0]); - $this->assertSame($rt, $result->operands[1]); - } - - - /** - * Tests __callStatic with target enum not existing - */ - public function testWithMissingEnum() - { - $this->expectException(BadMethodCallException::class); - - $lft = Value::make(1); - $rt = Value::make(2); - TestClass::MISSING($lft, $rt); - } -} - -enum TestEnum -{ - case EXAMPLE; -} - -class TestClass extends Expression -{ - use OperatorCallTrait; - - public TestEnum $enum; - - public OperandList $operands; - - public function __construct(TestEnum $enum, OperandList $operands) - { - $this->enum = $enum; - $this->operands = $operands; - } - - public static function getOperatorClass(): string - { - return TestEnum::class; - } -}; diff --git a/tests/Math/Expression/RelationalExpressionTest.php b/tests/Math/Expression/RelationalExpressionTest.php deleted file mode 100644 index fe8b8a96..00000000 --- a/tests/Math/Expression/RelationalExpressionTest.php +++ /dev/null @@ -1,140 +0,0 @@ -assertContains(OperatorCallTrait::class, $uses); - - $this->assertSame(RelationalOperator::class, RelationalExpression::getOperatorClass()); - - $operator = RelationalOperator::EQ; - - $lftOperand = $this->createMockForAbstract(Operand::class); - $rtOperand = $this->createMockForAbstract(Operand::class); - - $expression = new RelationalExpression( - $operator, - OperandList::make($lftOperand, $rtOperand) - ); - - $this->assertInstanceOf(Expression::class, $expression); - - $this->assertSame($lftOperand, $expression->getOperands()[0]); - $this->assertSame($rtOperand, $expression->getOperands()[1]); - } - - - /** - * Tests constructor with InvalidOperandException - */ - public function testConstructorWithInvalidOperandException() - { - $this->expectException(InvalidOperandException::class); - $this->expectExceptionMessage("expects 2 operands"); - - $operator = RelationalOperator::EQ; - new RelationalExpression( - $operator, - new OperandList() - ); - } - - /** - * Tests toString() - */ - public function testToString() - { - $operator = RelationalOperator::EQ; - $expression = new RelationalExpression( - $operator, - OperandList::make( - new Value(1), - new Value(2) - ) - ); - - $this->assertSame("(1==2)", $expression->toString()); - - $operator = RelationalOperator::LE; - $lftOp = RelationalOperator::NE; - $rtOp = RelationalOperator::GT; - - $expression = new RelationalExpression( - $operator, - OperandList::make( - new RelationalExpression( - $lftOp, - OperandList::make( - new VariableName("x"), - new VariableName("y") - ) - ), - new RelationalExpression( - $rtOp, - OperandList::make( - new VariableName("a"), - new VariableName("b") - ) - ) - ) - ); - - - $this->assertSame( - "((x!=y)<=(a>b))", - $expression->toString() - ); - } -} diff --git a/tests/Math/InvalidOperandExceptionTest.php b/tests/Math/InvalidOperandExceptionTest.php deleted file mode 100644 index fe10b90b..00000000 --- a/tests/Math/InvalidOperandExceptionTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertInstanceOf(InvalidArgumentException::class, $exception); - } -} diff --git a/tests/Math/OperandListTest.php b/tests/Math/OperandListTest.php deleted file mode 100644 index 06e216f0..00000000 --- a/tests/Math/OperandListTest.php +++ /dev/null @@ -1,93 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - - $this->assertSame(Operand::class, $list->getEntityType()); - } - - - /** - * Tests to array - */ - public function testToArray() - { - $list = $this->createList(); - - $entry1 = $this->createMockForAbstract( - Operand::class, - ["toArray"] - ); - $entry1->expects($this->once())->method("toString")->willReturn("entry1"); - $entry2 = $this->createMockForAbstract( - Operand::class, - ["toArray"] - ); - $entry2->expects($this->once())->method("toString")->willReturn("entry2"); - - $list[] = $entry1; - $list[] = $entry2; - - $this->assertEquals([ - "entry1", "entry2" - ], $list->toArray()); - } - - - /** - * @returnOperandList - */ - protected function createList(): OperandList - { - return new OperandList(); - } -} diff --git a/tests/Math/OperandTest.php b/tests/Math/OperandTest.php deleted file mode 100644 index ae61e1e9..00000000 --- a/tests/Math/OperandTest.php +++ /dev/null @@ -1,57 +0,0 @@ -createMockForAbstract(Operand::class); - $this->assertInstanceOf(Arrayable::class, $operand); - $this->assertInstanceOf(Jsonable::class, $operand); - $this->assertInstanceOf(Stringable::class, $operand); - } -} diff --git a/tests/Math/ValueTest.php b/tests/Math/ValueTest.php deleted file mode 100644 index 23f313f1..00000000 --- a/tests/Math/ValueTest.php +++ /dev/null @@ -1,102 +0,0 @@ -assertInstanceOf(Operand::class, $variableName); - - $this->assertSame("value", $variableName->getValue()); - - - $variableName = Value::make("value"); - $this->assertInstanceOf(Value::class, $variableName); - $this->assertSame("value", $variableName->getValue()); - } - - - /** - * Tests toArray() - */ - public function testToArray() - { - $variableName = new Value("value"); - - $this->assertSame(["value"], $variableName->toArray()); - } - - - /** - * Tests toJson() - */ - public function testToJson() - { - $variableName = new Value("value"); - $this->runToJsonTest($variableName); - } - - - /** - * Tests toString() - */ - public function testToString() - { - $tests = [[true, "true"], [false, "false"], [1, "1"], ["value", "value"]]; - - foreach ($tests as $test) { - $variableName = new Value($test[0]); - $this->assertSame($test[1], $variableName->toString()); - } - - $this->runToStringTest(Value::class); - } -} diff --git a/tests/Math/VariableNameTest.php b/tests/Math/VariableNameTest.php deleted file mode 100644 index 081b71c0..00000000 --- a/tests/Math/VariableNameTest.php +++ /dev/null @@ -1,98 +0,0 @@ -assertInstanceOf(Operand::class, $variableName); - - $this->assertSame("name", $variableName->getValue()); - - - $variableName = VariableName::make("name"); - $this->assertInstanceOf(VariableName::class, $variableName); - $this->assertSame("name", $variableName->getValue()); - } - - - /** - * Tests toArray() - */ - public function testToArray() - { - $variableName = new VariableName("name"); - - $this->assertSame(["name"], $variableName->toArray()); - } - - - /** - * Tests toJson() - */ - public function testToJson() - { - $variableName = new VariableName("name"); - $this->runToJsonTest($variableName); - } - - - /** - * Tests toString() - */ - public function testToString() - { - $variableName = new VariableName("name"); - $this->assertSame("name", $variableName->toString()); - - $this->runToStringTest(VariableName::class); - } -} diff --git a/tests/Math/VariableTest.php b/tests/Math/VariableTest.php deleted file mode 100644 index 65c6e935..00000000 --- a/tests/Math/VariableTest.php +++ /dev/null @@ -1,114 +0,0 @@ -assertInstanceOf(Operand::class, $variable); - - $this->assertSame($n, $variable->getName()); - $this->assertSame($v, $variable->getValue()); - - $variable = Variable::make("name", "value"); - $this->assertInstanceOf(Variable::class, $variable); - - $this->assertSame("name", $variable->getName()->getValue()); - $this->assertSame("value", $variable->getValue()->getValue()); - } - - - /** - * Tests toArray() - */ - public function testToArray() - { - $n = new VariableName("name"); - $v = new Value("value"); - - $variable = new Variable($n, $v); - - $this->assertSame([$n->toArray(), $v->toArray()], $variable->toArray()); - } - - - /** - * Tests toJson() - */ - public function testToJson() - { - $n = new VariableName("name"); - $v = new Value("value"); - - $variable = new Variable($n, $v); - $this->runToJsonTest($variable); - } - - - /** - * Tests toString() - */ - public function testToString() - { - $n = new VariableName("name"); - $v = new Value("value"); - - $variable = new Variable($n, $v); - $this->assertSame($n->toString() . ":" . $v->toString(), $variable->toString()); - - $this->runToStringTest(Variable::class); - } -} diff --git a/tests/Mime/MimeTypeTest.php b/tests/Mime/MimeTypeTest.php deleted file mode 100644 index fbdcf1eb..00000000 --- a/tests/Mime/MimeTypeTest.php +++ /dev/null @@ -1,62 +0,0 @@ -assertEqualsCanonicalizing( - [ - MimeType::TEXT_HTML, - MimeType::TEXT_PLAIN, - MimeType::IMAGE_JPEG - ], - MimeType::cases() - ); - - $this->assertSame("text/html", MimeType::TEXT_HTML->value); - $this->assertSame("text/plain", MimeType::TEXT_PLAIN->value); - $this->assertSame("image/jpeg", MimeType::IMAGE_JPEG->value); - } -} diff --git a/tests/Net/Exception/MalformedUrlExceptionTest.php b/tests/Net/Exception/MalformedUrlExceptionTest.php deleted file mode 100644 index fceaa052..00000000 --- a/tests/Net/Exception/MalformedUrlExceptionTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertInstanceOf(RuntimeException::class, $exception); - } -} diff --git a/tests/Net/Exception/UriSyntaxExceptionTest.php b/tests/Net/Exception/UriSyntaxExceptionTest.php deleted file mode 100644 index 8d45feb0..00000000 --- a/tests/Net/Exception/UriSyntaxExceptionTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertInstanceOf(RuntimeException::class, $exception); - } -} diff --git a/tests/Net/Uri/Component/Path/TemplateRegexTest.php b/tests/Net/Uri/Component/Path/TemplateRegexTest.php deleted file mode 100644 index 6bcf13be..00000000 --- a/tests/Net/Uri/Component/Path/TemplateRegexTest.php +++ /dev/null @@ -1,140 +0,0 @@ - "tpl", - "output" => "/tpl\??[^\/]*$/m" - ], [ - "input" => "/tpl/{resourceId}", - "output" => "/^\/tpl\/(?[^\?\/]+)\??[^\/]*$/m" - ], [ - "input" => "tpl/resource/{resourceId}/hierarchy/{subItemId}", - "output" => "/tpl\/resource\/(?[^\?\/]+)\/" . - "hierarchy\/(?[^\?\/]+)\??[^\/]*$/m" - ], [ - "input" => "tpl/resource/{resourceId}/hierarchy/{subItemId}/index.php?query=foo", - "output" => "/tpl\/resource\/(?[^\?\/]+)\/hierarchy" . - "\/(?[^\?\/]+)\/index.php\?query=foo\??[^\/]*$/m" - ], [ - "input" => "tpl/{resourceId}", - "output" => "/tpl\/(?[^\?\/]+)\??[^\/]*$/m" - ]]; - - foreach ($tests as $test) { - ["input" => $input, "output" => $output] = $test; - - $pathTemplateRegex = new TemplateRegex($input); - $getRegexString = $this->makeAccessible($pathTemplateRegex, "getRegexString"); - - $this->assertSame($output, $getRegexString->invokeArgs($pathTemplateRegex, [])); - } - } - - - /** - * Tests match() - * @return void - */ - public function testMatch(): void - { - $tests = [[ - "cArg" => "tpl", - "input" => "tpl", - "output" => [] - ], [ - "cArg" => "/tpl/{resourceId}", - "input" => "someUri", - "output" => null - ], [ - "cArg" => "/Resources/{resourceId}", - "input" => "/Resources", - "output" => null - ], [ - "cArg" => "/tpl/{resourceId}", - "input" => "/tpl/1?someParam=someValue", - "output" => [ - "resourceId" => "1" - ] - ], [ - "cArg" => "tpl/resource/{resourceId}/hierarchy/{subItemId}/subpart", - "input" => "tpl/resource/123/hierarchy/456/subpart", - "output" => [ - "resourceId" => "123", - "subItemId" => "456" - ] - ], [ - "cArg" => "tpl/resource/{resourceId}/hierarchy/{subItemId}", - "input" => "tpl/resource/123/hierarchy/456", - "output" => [ - "resourceId" => "123", - "subItemId" => "456" - ] - ], [ - "cArg" => "tpl/resource/{resourceId}/hierarchy/{subItemId}/index.php", - "input" => "tpl/resource/123/hierarchy/456/index.php?query=foo", - "output" => [ - "resourceId" => "123", - "subItemId" => "456" - ], - ], [ - "cArg" => "tpl/resource", - "input" => "tpl/resource", - "output" => [], - ]]; - - foreach ($tests as $test) { - ["cArg" => $cArg, "input" => $input, "output" => $output] = $test; - - $pathTemplateRegex = new TemplateRegex($cArg); - if ($output === null) { - $this->assertNull($pathTemplateRegex->match($input)); - } else { - $this->assertEquals($output, $pathTemplateRegex->match($input)); - } - } - } -} diff --git a/tests/Net/Uri/Component/Path/TemplateTest.php b/tests/Net/Uri/Component/Path/TemplateTest.php deleted file mode 100644 index bc5d0b98..00000000 --- a/tests/Net/Uri/Component/Path/TemplateTest.php +++ /dev/null @@ -1,166 +0,0 @@ -assertInstanceOf(Stringable::class, $tpl); - $this->assertInstanceOf(Equatable::class, $tpl); - } - - /** - * Tests equals() with InvalidTypeException - * @return void - */ - public function testEqualsWithException(): void - { - $this->expectException(InvalidTypeException::class); - - $tplLft = new Template("/MailFolder/{mailFolderId}"); - - $equatable = new class implements Equatable { - public function equals(object $target): bool - { - return true; - } - }; - - $tplLft->equals($equatable); - } - - - /** - * Tests equals() - * @return void - */ - public function testEquals(): void - { - $tplLft = new Template("/MailFolder/{mailFolderId}"); - $tplYes = new Template("/MAILFOLDER/{mailFolderId}"); - $tplNo = new Template("/SnailFolder/{mailFolderId}"); - - $this->assertTrue($tplLft->equals($tplYes)); - $this->assertFalse($tplLft->equals($tplNo)); - } - - /** - * Tests getTemplateString() - * - * @return void - */ - public function testGetPathParameterNames(): void - { - $tests = [[ - "input" => "tpl", - "output" => [] - ], [ - "input" => "/tpl/{resourceId}", - "output" => [ - "resourceId" - ] - ], [ - "input" => "/Resources/{resourceId}", - "output" => [ - "resourceId" - ] - ], [ - "input" => "/tpl/{resourceId}", - "output" => [ - "resourceId" - ] - ], [ - "input" => "tpl/resource/{resourceId}/hierarchy/{subItemId}/subpart", - "output" => [ - "resourceId", "subItemId" - ] - ], [ - "input" => "tpl/resource/{resourceId}/hierarchy/{subItemId}/index.php", - "output" => [ - "resourceId", "subItemId" - ], - ]]; - - foreach ($tests as $test) { - ["input" => $input, "output" => $output] = $test; - - $uriTemplate = new Template($input); - $this->assertEquals($output, $uriTemplate->getVariableNames()); - } - } - - - /** - * tests match() - * @return void - */ - public function testMatch(): void - { - $tpl = new Template("/MailFolder/{mailFolderId}"); - - $this->assertSame( - ["mailFolderId" => "2"], - $tpl->match(Uri::make("https://localhost:8080/MailFolder/2?query=value")) - ); - - $this->assertNull( - $tpl->match(Uri::make("https://localhost:8080/path/MailFolder/2?query=value")) - ); - - // relative path - $tpl = new Template("MailFolder/{mailFolderId}"); - $this->assertSame( - ["mailFolderId" => "2"], - $tpl->match(Uri::make("https://localhost:8080/pathMailFolder/2?query=value")) - ); - - $tpl = new Template("/employees"); - $this->assertSame( - [], - $tpl->match(Uri::make("https://localhost:8080/employees")) - ); - } -} diff --git a/tests/Net/Uri/Component/Query/ParameterListTest.php b/tests/Net/Uri/Component/Query/ParameterListTest.php deleted file mode 100644 index debdc79e..00000000 --- a/tests/Net/Uri/Component/Query/ParameterListTest.php +++ /dev/null @@ -1,84 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - - $this->assertSame(Parameter::class, $list->getEntityType()); - } - - - /** - * Tests to array - */ - public function testToArray(): void - { - $list = $this->createList(); - - $this->assertEquals([ - "A" => "B", - "C" => "D" - ], $list->toArray()); - } - - - /** - * @return ParameterList - */ - protected function createList(): ParameterList - { - $list = new ParameterList(); - $list[] = new Parameter("A", "B"); - $list[] = new Parameter("C", "D"); - - return $list; - } -} diff --git a/tests/Net/Uri/Component/Query/ParameterTest.php b/tests/Net/Uri/Component/Query/ParameterTest.php deleted file mode 100644 index da2007a7..00000000 --- a/tests/Net/Uri/Component/Query/ParameterTest.php +++ /dev/null @@ -1,68 +0,0 @@ -getQueryParameter("name", "value"); - - $this->assertInstanceOf(ErrorSource::class, $mock); - $this->assertSame("value", $mock->getValue()); - - $this->assertSame("name", $mock->getName()); - $this->assertSame("name=value", $mock->toString()); - $this->assertSame($mock, $mock->getSource()); - $this->assertSame(["parameter" => $mock->getName()], $mock->toArray()); - } - - - /** - * @param string $name - * @param string $value - * @return Parameter - */ - protected function getQueryParameter(string $name, string $value): Parameter - { - return new Parameter($name, $value); - } -} diff --git a/tests/Net/Uri/Component/Query/ParameterTraitTest.php b/tests/Net/Uri/Component/Query/ParameterTraitTest.php deleted file mode 100644 index d484ab65..00000000 --- a/tests/Net/Uri/Component/Query/ParameterTraitTest.php +++ /dev/null @@ -1,115 +0,0 @@ - true, - "fields[]" => true, - "fields" => false, - "parameter" => false, - "fields[MailFolder.MailAccount]" => true - ]; - - foreach ($tests as $input => $expected) { - /** @phpstan-ignore-next-line */ - $this->assertSame($expected, $this->getTrait()->isGroupParameter($input)); - /** @phpstan-ignore-next-line */ - $this->assertSame($expected, $this->getTrait()->isGroupParameter(new Parameter($input, ""))); - } - } - - /** - * tests getGroupName() - */ - public function testGetGroupName(): void - { - $tests = [ - "fields[MailFolder]" => "fields", - "foo[]" => "foo", - "fields" => null, - "parameter" => null, - "A[MailFolder.MailAccount]" => "A" - ]; - - foreach ($tests as $input => $expected) { - /** @phpstan-ignore-next-line */ - $this->assertSame($expected, $this->getTrait()->getGroupName($input)); - /** @phpstan-ignore-next-line */ - $this->assertSame($expected, $this->getTrait()->getGroupName(new Parameter($input, ""))); - } - } - - - /** - * tests getGroupKey() - */ - public function testGetGroupKey(): void - { - $tests = [ - "fields[MailFolder]" => "MailFolder", - "fields" => null, - "fields[]" => null, - "parameter" => null, - "A[MailFolder.MailAccount]" => "MailFolder.MailAccount" - ]; - - foreach ($tests as $input => $expected) { - /** @phpstan-ignore-next-line */ - $this->assertSame($expected, $this->getTrait()->getGroupKey($input)); - /** @phpstan-ignore-next-line */ - $this->assertSame($expected, $this->getTrait()->getGroupKey(new Parameter($input, ""))); - } - } - - - /** - * @return object - */ - protected function getTrait(): object - { - return new class () { - use ParameterTrait; - }; - } -} diff --git a/tests/Net/Uri/Component/QueryTest.php b/tests/Net/Uri/Component/QueryTest.php deleted file mode 100644 index dd20f593..00000000 --- a/tests/Net/Uri/Component/QueryTest.php +++ /dev/null @@ -1,214 +0,0 @@ -getTestedClass()); - /** @phpstan-ignore-next-line */ - $this->assertContains(ParameterTrait::class, $uses); - } - - - /** - * tests getParameter() - * @return void - */ - public function testGetParameter(): void - { - $query = $this->createTestInstance("parameter=value"); - - $parameter = $query->getParameter("parameter"); - $this->assertNotNull($parameter); - - // check idempotence - $this->assertSame($parameter, $query->getParameter("parameter")); - - $missing = $query->getParameter("missing"); - $this->assertNull($missing); - - $this->assertSame($missing, $query->getParameter("missing")); - - $this->assertSame("value", $parameter->getValue()); - } - - /** - * tests getParameter() with parameters compiled to arrays - * @return void - */ - public function testGetParameterWithBrackets(): void - { - $query = $this->createTestInstance( - "fields[A]=valueA&fields[B]=valueB" - ); - - $this->assertNull($query->getParameter("fields")); - - $fieldsA = $query->getParameter("fields[A]"); - $this->assertNotNull($fieldsA); - $this->assertSame($fieldsA, $query->getParameter("fields[A]")); - $this->assertSame("valueA", $fieldsA->getValue()); - - $fieldsB = $query->getParameter("fields[B]"); - $this->assertNotNull($fieldsB); - - $fieldsC = $query->getParameter("fields[C]"); - $this->assertNull($fieldsC); - } - - - /** - * tests getAllParameterNames() with parameters compiled to arrays - * @return void - */ - public function testGetAllParameterNames(): void - { - $query = $this->createTestInstance(); - $this->assertEquals([], $query->getAllParameterNames()); - - $query = $this->createTestInstance( - "C=D&fields[A]=valueA&fields[B]=valueB" - ); - - $this->assertEquals(["C", "fields[A]", "fields[B]"], $query->getAllParameterNames()); - } - - - /** - * tests getAllParameters() - * @return void - */ - public function testGetAllParameters(): void - { - $query = $this->createTestInstance(); - $this->assertEquals([], $query->getAllParameters()->toArray()); - - $query = $this->createTestInstance( - "C=D&fields[A]=valueA&fields[B]=valueB" - ); - - $list = $query->getAllParameters(); - $this->assertSame($list, $query->getAllParameters()); - - $this->assertEquals([ - "C" => "D", - "fields[A]" => "valueA", - "fields[B]" => "valueB" - ], $query->getAllParameters()->toArray()); - } - - - /** - * tests getSource() - * @return void - */ - public function testGetSource(): void - { - $query = $this->createTestInstance(); - $this->assertSame($query, $query->getSource()); - } - - - /** - * tests toString() and getName() and toArray() - * @return void - */ - public function testToStringAndGetNameAndToArray(): void - { - - $query = $this->createTestInstance("query=string"); - - $this->assertSame("query=string", $query->toString()); - $this->assertSame($query->toString(), $query->getName()); - - $this->assertSame([ - "query" => "string" - ], $query->toArray()); - - $this->runToStringTest(Query::class); - } - - - /** - * tests getParameterBag() - * @return void - */ - public function testGetParameterBag(): void - { - - $query = $this->createTestInstance("fields[MessageItem]=a,b,c&sort=subject,-date"); - - $parameterBag = $query->getParameterBag(); - - $this->assertSame( - [ - "fields[MessageItem]" => "a,b,c", - "sort" => "subject,-date" - ], - $parameterBag->toJson() - ); - } - - - /** - * @param string|null $queryString - * @return Query - */ - protected function createTestInstance(string $queryString = null): Query - { - return new Query($queryString); - } - - - /** - * @return string - */ - protected function getTestedClass(): string - { - return Query::class; - } -} diff --git a/tests/Net/UriTest.php b/tests/Net/UriTest.php deleted file mode 100644 index bc8078ee..00000000 --- a/tests/Net/UriTest.php +++ /dev/null @@ -1,154 +0,0 @@ -expectException(UriSyntaxException::class); - - $this->createInstanceToTest(["https://host:port"]); - } - - - public function testMagicCallToGetters(): void - { - $parts = ["scheme", "user", "pass", "host", "port", "path", "query", "fragment"]; - - $tests = $this->getTestsForMagicCallToGetters(); - - foreach ($tests as $test) { - ["input" => $input, "output" => $output, "isAbsolute" => $isAbsolute] = $test; - - $uri = $this->createInstanceToTest([$input]); - - foreach ($parts as $part) { - $method = "get" . ucfirst($part); - $this->assertSame($output[$part] ?? null, $uri->{$method}()); - } - - $this->assertSame($isAbsolute, $uri->isAbsolute()); - } - } - - - public function testMagicCallWithBadMethodCallException(): void - { - $this->expectException(BadMethodCallException::class); - - $uri = $this->createInstanceToTest(["https://uri.com"]); - - /** @phpstan-ignore-next-line */ - $uri->methodDoesNotExist(); - } - - - public function testToString(): void - { - $this->runToStringTest($this->getClassToTest()); - } - - - /** - * @return array|bool>> - */ - protected function getTestsForMagicCallToGetters(): array - { - return [[ - "input" => "scheme://user:pass@host:8080/path?query#fragment", - "output" => [ - "scheme" => "scheme", - "user" => "user", - "pass" => "pass", - "host" => "host", - "port" => 8080, - "path" => "/path", - "query" => "query", - "fragment" => "fragment" - ], - "isAbsolute" => true - ], [ - "input" => "./path?query=string", - "output" => [ - "path" => "./path", - "query" => "query=string" - ], - "isAbsolute" => false - ], [ - "input" => "https://localhost/../path", - "output" => [ - "scheme" => "https", - "host" => "localhost", - "path" => "/../path" - ], - "isAbsolute" => true - ], [ - "input" => "//localhost/../path", - "output" => [ - "host" => "localhost", - "path" => "/../path" - ], - "isAbsolute" => false - ]]; - } - - - /** - * @param array $arguments - * @return Uri - */ - protected function createInstanceToTest(array $arguments): Uri - { - $className = $this->getClassToTest(); - /** - * @var Uri $ret - */ - $ret = new $className(...$arguments); - return $ret; - } - - - protected function getClassToTest(): string - { - return Uri::class; - } -} diff --git a/tests/Net/UrlTest.php b/tests/Net/UrlTest.php deleted file mode 100644 index 006a3bca..00000000 --- a/tests/Net/UrlTest.php +++ /dev/null @@ -1,97 +0,0 @@ -expectException(MalformedUrlException::class); - - $this->createInstanceToTest(["host/somePath"]); - } - - - /** - * @return array> - */ - protected function getTestsForMagicCallToGetters(): array - { - return [[ - "input" => "scheme://user:pass@host:8080/path?query#fragment", - "output" => [ - "scheme" => "scheme", - "user" => "user", - "pass" => "pass", - "host" => "host", - "port" => 8080, - "path" => "/path", - "query" => "query", - "fragment" => "fragment" - ], - "isAbsolute" => true - ], [ - "input" => "https://localhost/../path", - "output" => [ - "scheme" => "https", - "host" => "localhost", - "path" => "/../path" - ], - "isAbsolute" => true - ]]; - } - - - /** - * @param array $arguments - * @return Url - */ - protected function createInstanceToTest(array $arguments): Url - { - $className = $this->getClassToTest(); - /** - * @var Url $ret - */ - $ret = new $className(...$arguments); - return $ret; - } - - - protected function getClassToTest(): string - { - return Url::class; - } -} diff --git a/tests/StringableTestTrait.php b/tests/StringableTestTrait.php deleted file mode 100644 index c45a3a77..00000000 --- a/tests/StringableTestTrait.php +++ /dev/null @@ -1,76 +0,0 @@ -getMockBuilder($className) - ->onlyMethods(["toString"]) - ->disableOriginalConstructor() - ->getMock(); - $targetWithoutStrategy->expects($this->once()) - ->method("toString") - ->with(null) - ->willReturn($expected); - $this->assertInstanceOf(Stringable::class, $targetWithoutStrategy); - - $this->assertSame($expected, $targetWithoutStrategy->toString(null)); - - // w/ strategy - $target = $this->getMockBuilder($className) - ->onlyMethods([]) - ->disableOriginalConstructor() - ->getMock(); - $expectedFromStrategy = $expected . "_fromStrategy"; - $strategyStub = $this->createMockForAbstract(StringStrategy::class); - - $strategyStub - ->expects($this->once()) - ->method("toString") - ->with($target) - ->willReturn($expectedFromStrategy); - $this->assertSame($expectedFromStrategy, $target->toString($strategyStub)); - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php index 7d49c891..90cd519e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -29,12 +29,13 @@ namespace Tests; -use PHPUnit\Framework\MockObject\MockObject; -use ReflectionClass; +use App\Exceptions\Handler; +use Exception; +use Illuminate\Support\Facades\Config; +use Laravel\Lumen\Application; +use RuntimeException; +use Illuminate\Http\Response; use PHPUnit\Framework\TestCase as PHPUnitTestCase; -use ReflectionException; -use ReflectionMethod; -use ReflectionProperty; /** * Class TestCase @@ -42,50 +43,4 @@ */ abstract class TestCase extends PHPUnitTestCase { - /** - * - * @param string $originalClassName - * @param array $mockedMethods - * @param array $args - * @return mixed - */ - protected function createMockForAbstract( - string $originalClassName, - array $mockedMethods = [], - array $args = [] - ): mixed { - return parent::getMockForAbstractClass( - $originalClassName, - $args, - '', - true, - true, - true, - $mockedMethods - ); - } - - - /** - * @param mixed $inst - * @param $name - * @param bool $isProperty - * - * @return ($isProperty is true ? ReflectionProperty : ReflectionMethod) - * - * @throws ReflectionException - */ - protected function makeAccessible($inst, $name, bool $isProperty = false): ReflectionMethod|ReflectionProperty - { - $refl = new ReflectionClass($inst); - - $name = match ($isProperty) { - true => $refl->getProperty($name), - default => $refl->getMethod($name), - }; - - $name->setAccessible(true); - - return $name; - } } diff --git a/tests/TestTrait.php b/tests/TestTrait.php index 7c2da656..fc8e1cbd 100644 --- a/tests/TestTrait.php +++ b/tests/TestTrait.php @@ -29,7 +29,7 @@ namespace Tests; -use Conjoon\MailClient\Data\MailAccount; +use Conjoon\Mail\Client\Data\MailAccount; use Illuminate\Contracts\Auth\Authenticatable; use PHPUnit\Framework\MockObject\MockObject; use ReflectionClass; diff --git a/tests/Util/AbstractListTest.php b/tests/Util/AbstractListTest.php new file mode 100644 index 00000000..1aeadef6 --- /dev/null +++ b/tests/Util/AbstractListTest.php @@ -0,0 +1,115 @@ +getMockForAbstractList(); + $this->assertSame(stdClass::class, $abstractList->getEntityType()); + $this->assertInstanceOf(Countable::class, $abstractList); + $this->assertInstanceOf(ArrayAccess::class, $abstractList); + $this->assertInstanceOf(Iterator::class, $abstractList); + } + + + /** + * Tests ArrayAccess /w type exception + */ + public function testArrayAccessException() + { + + $this->expectException(TypeError::class); + + $abstractList = $this->getMockForAbstractList(); + $abstractList[] = "foo"; + } + + + /** + * Tests ArrayAccess + */ + public function testArrayAccessAndCountable() + { + + $abstractList = $this->getMockForAbstractList(); + + $cmpList = [ + new stdClass(), + new stdClass() + ]; + + $abstractList[] = $cmpList[0]; + $abstractList[] = $cmpList[1]; + + $this->assertSame(2, count($abstractList)); + + foreach ($abstractList as $key => $item) { + $this->assertSame($cmpList[$key], $item); + } + } + + +// --------------------- +// Helper Functions +// --------------------- + + protected function getMockForAbstractList() + { + + $mock = $this->getMockForAbstractClass(AbstractList::class); + $mock->expects($this->any()) + ->method("getEntityType") + ->will($this->returnValue(stdClass::class)); + + return $mock; + } +} diff --git a/tests/Core/Util/ArrayUtilTest.php b/tests/Util/ArrayUtilTest.php similarity index 98% rename from tests/Core/Util/ArrayUtilTest.php rename to tests/Util/ArrayUtilTest.php index 133cc438..55baff02 100644 --- a/tests/Core/Util/ArrayUtilTest.php +++ b/tests/Util/ArrayUtilTest.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Tests\Conjoon\Core\Util; +namespace Tests\Conjoon\Util; -use Conjoon\Core\Util\ArrayUtil; +use Conjoon\Util\ArrayUtil; use InvalidArgumentException; use Tests\TestCase; diff --git a/tests/Core/Contract/JsonDecodableTest.php b/tests/Util/JsonDecodableTest.php similarity index 93% rename from tests/Core/Contract/JsonDecodableTest.php rename to tests/Util/JsonDecodableTest.php index 2753d1cb..048a9ad8 100644 --- a/tests/Core/Contract/JsonDecodableTest.php +++ b/tests/Util/JsonDecodableTest.php @@ -27,11 +27,11 @@ declare(strict_types=1); -namespace Tests\Conjoon\Core\Contract; +namespace Tests\Conjoon\Util; -use Conjoon\Core\Contract\Jsonable; -use Conjoon\Core\Contract\JsonDecodable; -use Conjoon\Core\Contract\JsonStrategy; +use Conjoon\Util\Jsonable; +use Conjoon\Util\JsonDecodable; +use Conjoon\Util\JsonStrategy; use Tests\TestCase; /** diff --git a/tests/Core/Exception/JsonDecodeExceptionTest.php b/tests/Util/JsonDecodeExceptionTest.php similarity index 94% rename from tests/Core/Exception/JsonDecodeExceptionTest.php rename to tests/Util/JsonDecodeExceptionTest.php index 8f0689f0..4812c3f9 100644 --- a/tests/Core/Exception/JsonDecodeExceptionTest.php +++ b/tests/Util/JsonDecodeExceptionTest.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Tests\Conjoon\Core\Exception; +namespace Tests\Conjoon\Util; -use Conjoon\Core\Exception\JsonDecodeException; +use Conjoon\Util\JsonDecodeException; use RuntimeException; use Tests\TestCase; diff --git a/tests/Core/Contract/JsonableTest.php b/tests/Util/JsonableTest.php similarity index 96% rename from tests/Core/Contract/JsonableTest.php rename to tests/Util/JsonableTest.php index 9325e2e3..3450603b 100644 --- a/tests/Core/Contract/JsonableTest.php +++ b/tests/Util/JsonableTest.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Tests\Conjoon\Core\Contract; +namespace Tests\Conjoon\Util; -use Conjoon\Core\Contract\Jsonable; +use Conjoon\Util\Jsonable; use Tests\TestCase; /** @@ -49,6 +49,7 @@ class JsonableTest extends TestCase */ public function testConstructor() { + $jsonable = $this->getMockForJsonable(); $this->assertSame(self::$myJson, $jsonable->toJson()); } @@ -61,6 +62,7 @@ public function testConstructor() protected function getMockForJsonable() { + $mock = $this->getMockForAbstractClass(Jsonable::class); $mock->expects($this->any()) ->method("toJson") diff --git a/tests/Data/ModifiableTraitTest.php b/tests/Util/ModifiableTraitTest.php similarity index 97% rename from tests/Data/ModifiableTraitTest.php rename to tests/Util/ModifiableTraitTest.php index 6fab4365..4e477c69 100644 --- a/tests/Data/ModifiableTraitTest.php +++ b/tests/Util/ModifiableTraitTest.php @@ -27,9 +27,9 @@ declare(strict_types=1); -namespace Tests\Conjoon\Core\Data; +namespace Tests\Conjoon\Util; -use Conjoon\Data\ModifiableTrait; +use Conjoon\Util\ModifiableTrait; use Tests\TestCase; /** diff --git a/tests/Web/Validation/Exception/InvalidQueryParameterValueExceptionTest.php b/tests/Web/Validation/Exception/InvalidQueryParameterValueExceptionTest.php deleted file mode 100644 index 7ffffe1c..00000000 --- a/tests/Web/Validation/Exception/InvalidQueryParameterValueExceptionTest.php +++ /dev/null @@ -1,52 +0,0 @@ -assertInstanceOf(QueryException::class, $exception); - } -} diff --git a/tests/Web/Validation/Exception/QueryExceptionTest.php b/tests/Web/Validation/Exception/QueryExceptionTest.php deleted file mode 100644 index 00fec370..00000000 --- a/tests/Web/Validation/Exception/QueryExceptionTest.php +++ /dev/null @@ -1,51 +0,0 @@ -getMockForAbstractClass(QueryException::class); - - $this->assertInstanceOf(RuntimeException::class, $exception); - } -} diff --git a/tests/Web/Validation/Exception/UnexpectedQueryExceptionTest.php b/tests/Web/Validation/Exception/UnexpectedQueryExceptionTest.php deleted file mode 100644 index aa40985e..00000000 --- a/tests/Web/Validation/Exception/UnexpectedQueryExceptionTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertInstanceOf(QueryException::class, $exception); - } -} diff --git a/tests/Web/Validation/Exception/UnexpectedQueryParameterExceptionTest.php b/tests/Web/Validation/Exception/UnexpectedQueryParameterExceptionTest.php deleted file mode 100644 index 607871c0..00000000 --- a/tests/Web/Validation/Exception/UnexpectedQueryParameterExceptionTest.php +++ /dev/null @@ -1,51 +0,0 @@ -assertInstanceOf(QueryException::class, $exception); - } -} diff --git a/tests/Web/Validation/Parameter/ParameterRuleListTest.php b/tests/Web/Validation/Parameter/ParameterRuleListTest.php deleted file mode 100644 index 509a699f..00000000 --- a/tests/Web/Validation/Parameter/ParameterRuleListTest.php +++ /dev/null @@ -1,64 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - - $this->assertSame(ParameterRule::class, $list->getEntityType()); - } - - - /** - * @return ParameterRuleList - */ - protected function createList(): ParameterRuleList - { - $list = new ParameterRuleList(); - - - return $list; - } -} diff --git a/tests/Web/Validation/Parameter/ParameterRuleTest.php b/tests/Web/Validation/Parameter/ParameterRuleTest.php deleted file mode 100644 index 14db363b..00000000 --- a/tests/Web/Validation/Parameter/ParameterRuleTest.php +++ /dev/null @@ -1,120 +0,0 @@ -createMockForAbstract(ParameterRule::class); - $this->assertInstanceOf(ValidationRule::class, $rule); - } - - - /** - * test supports() - */ - public function testSupports(): void - { - /** - * @var MockObject&ParameterRule $rule - */ - $rule = $this->createMockForAbstract(ParameterRule::class); - - $this->assertTrue($rule->supports(new Parameter("name", "value"))); - $this->assertFalse($rule->supports(new stdClass())); - } - - - /** - * test isValid() throwing UnexpectedQueryParameterException - */ - public function testIsValidWithUnexpectedQueryParameterException(): void - { - $parameter = new Parameter("include", "none"); - - /** - * @var MockObject&ParameterRule $rule - */ - $rule = $this->createMockForAbstract(ParameterRule::class, ["supports"]); - $rule->expects($this->once()) - ->method("supports") - ->with($parameter) - ->willReturn(false); - - $this->expectException(UnexpectedQueryParameterException::class); - - - $rule->isValid($parameter, new ValidationErrors()); - } - - /** - * test isValid() delegating to validate - */ - public function testIsValid(): void - { - $parameter = $this->getMockBuilder(Parameter::class)->disableOriginalConstructor()->getMock(); - $errors = new ValidationErrors(); - - /** - * @var ParameterRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(ParameterRule::class, ["supports", "validate"]); - $rule->expects($this->once()) - ->method("validate") - ->with($parameter, $errors) - ->willReturn(true); - - $rule->expects($this->once()) - ->method("supports") - ->with($parameter) - ->willReturn(true); - - $this->assertSame(true, $rule->isValid($parameter, $errors)); - } -} diff --git a/tests/Web/Validation/Parameter/Rule/IntegerValueRuleTest.php b/tests/Web/Validation/Parameter/Rule/IntegerValueRuleTest.php deleted file mode 100644 index e6a0e611..00000000 --- a/tests/Web/Validation/Parameter/Rule/IntegerValueRuleTest.php +++ /dev/null @@ -1,128 +0,0 @@ -makeAccessible($rule, "parameterName", true); - $this->assertSame("name", $parameterName->getValue($rule)); - $this->assertInstanceOf(NamedParameterRule::class, $rule); - - // make sure passing array is okay - $rule = new IntegerValueRule(["name"]); - $parameterName = $this->makeAccessible($rule, "parameterName", true); - $this->assertSame(["name"], $parameterName->getValue($rule)); - } - - /** - * test wrong operator throws InvalidArgumentException - */ - public function testConstructorWithInvalidArgumentException(): void - { - $this->expectException(InvalidArgumentException::class); - new IntegerValueRule("name", "/"); - } - - - /** - * tests validate() - */ - public function testValidate(): void - { - $errors = new ValidationErrors(); - - // simple validate type - $rule = new IntegerValueRule("limit"); - $this->assertFalse($rule->isValid(new Parameter("limit", "string_value"), $errors)); - /** - * @var ValidationError $err - */ - $err = $errors->peek(); - $this->assertStringContainsString("cannot be treated as integer", $err->getDetails()); - - $rule = new IntegerValueRule("limit"); - $this->assertTrue($rule->isValid(new Parameter("limit", "1234"), $errors)); - - $rule = new IntegerValueRule("limit"); - $this->assertFalse($rule->isValid(new Parameter("limit", "01234"), $errors)); - - // equality - $rule = new IntegerValueRule("limit", "=", 1); - $this->assertTrue($rule->isValid(new Parameter("limit", "1"), $errors)); - $this->assertFalse($rule->isValid(new Parameter("limit", "123"), $errors)); - /** - * @var ValidationError $err - */ - $err = $errors->peek(); - $this->assertStringContainsString("is not = 1", $err->getDetails()); - - // greater than - $rule = new IntegerValueRule("limit", ">", 1); - $this->assertTrue($rule->isValid(new Parameter("limit", "2"), $errors)); - $this->assertFalse($rule->isValid(new Parameter("limit", "-1"), $errors)); - - // greater than or equal to - $rule = new IntegerValueRule("limit", ">=", 1); - $this->assertTrue($rule->isValid(new Parameter("limit", "2"), $errors)); - $this->assertTrue($rule->isValid(new Parameter("limit", "1"), $errors)); - - // less than - $rule = new IntegerValueRule("limit", "<", 1); - $this->assertTrue($rule->isValid(new Parameter("limit", "0"), $errors)); - $this->assertFalse($rule->isValid(new Parameter("limit", "2"), $errors)); - - // less than or equal to - $rule = new IntegerValueRule("limit", "<=", 1); - $this->assertTrue($rule->isValid(new Parameter("limit", "-2"), $errors)); - $this->assertTrue($rule->isValid(new Parameter("limit", "1"), $errors)); - - // not equal to - $rule = new IntegerValueRule("limit", "!=", 1); - $this->assertTrue($rule->isValid(new Parameter("limit", "-2"), $errors)); - $this->assertFalse($rule->isValid(new Parameter("limit", "1"), $errors)); - } -} diff --git a/tests/Web/Validation/Parameter/Rule/JsonEncodedRuleTest.php b/tests/Web/Validation/Parameter/Rule/JsonEncodedRuleTest.php deleted file mode 100644 index 5effd188..00000000 --- a/tests/Web/Validation/Parameter/Rule/JsonEncodedRuleTest.php +++ /dev/null @@ -1,76 +0,0 @@ -assertInstanceOf(NamedParameterRule::class, $rule); - } - - - /** - * tests validate() - */ - public function testValidate(): void - { - $errors = new ValidationErrors(); - - // simple validate type - $rule = new JsonEncodedRule("filter"); - $this->assertFalse($rule->isValid(new Parameter("filter", "string_value"), $errors)); - /** - * @var ValidationError $err - */ - $err = $errors->peek(); - $this->assertStringContainsString("Could not decode", $err->getDetails()); - - $rule = new JsonEncodedRule("filter"); - $this->assertTrue($rule->isValid( - new Parameter("filter", (string)json_encode(["key" => "value"])), - $errors - )); - } -} diff --git a/tests/Web/Validation/Parameter/Rule/NamedParameterRuleTest.php b/tests/Web/Validation/Parameter/Rule/NamedParameterRuleTest.php deleted file mode 100644 index ff7e7df2..00000000 --- a/tests/Web/Validation/Parameter/Rule/NamedParameterRuleTest.php +++ /dev/null @@ -1,98 +0,0 @@ -createMockForAbstract(NamedParameterRule::class, [], ["parameter_name"]); - $parameterName = $this->makeAccessible($rule, "parameterName", true); - $this->assertSame("parameter_name", $parameterName->getValue($rule)); - $this->assertInstanceOf(ParameterRule::class, $rule); - - /** - * @var NamedParameterRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(NamedParameterRule::class, [], [["parameter_name"]]); - $parameterName = $this->makeAccessible($rule, "parameterName", true); - $this->assertSame(["parameter_name"], $parameterName->getValue($rule)); - } - - - /** - * tests supports() - */ - public function testSupports(): void - { - /** - * @var NamedParameterRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(NamedParameterRule::class, [], ["name"]); - - $this->assertTrue( - $rule->supports(new Parameter("name", "value")) - ); - $this->assertFalse( - $rule->supports(new Parameter("unknown", "value")) - ); - $this->assertFalse( - $rule->supports(new stdClass()) - ); - - /** - * @var NamedParameterRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(NamedParameterRule::class, [], [["name", "second_name"]]); - - $this->assertTrue( - $rule->supports(new Parameter("name", "value")) - ); - $this->assertTrue( - $rule->supports(new Parameter("second_name", "value")) - ); - } -} diff --git a/tests/Web/Validation/Parameter/Rule/ValueInWhitelistRuleTest.php b/tests/Web/Validation/Parameter/Rule/ValueInWhitelistRuleTest.php deleted file mode 100644 index 98da29fb..00000000 --- a/tests/Web/Validation/Parameter/Rule/ValueInWhitelistRuleTest.php +++ /dev/null @@ -1,154 +0,0 @@ -makeAccessible($rule, "parameterName", true); - $this->assertSame("name", $parameterName->getValue($rule)); - $this->assertInstanceOf(NamedParameterRule::class, $rule); - - // make sure passing array is okay - $rule = new ValueInWhitelistRule(["name"], []); - $parameterName = $this->makeAccessible($rule, "parameterName", true); - $this->assertSame(["name"], $parameterName->getValue($rule)); - } - - - /** - * tests getWhitelist - */ - public function testGetWhitelist(): void - { - $whitelist = ["-1", "all"]; - - $rule = new ValueInWhitelistRule("name", $whitelist); - $this->assertEquals($whitelist, $rule->getWhitelist()); - } - - /** - * tests isParameterValueValid() - */ - public function testIsParameterValueValid(): void - { - $rule = new ValueInWhitelistRule("name", []); - $isParameterValueValid = $this->makeAccessible($rule, "isParameterValueValid"); - - $this->assertTrue($isParameterValueValid->invokeArgs( - $rule, - [new Parameter("valid", "value"), ["value"]] - )); - - $this->assertFalse($isParameterValueValid->invokeArgs( - $rule, - [new Parameter("valid", "invalid"), ["value"]] - )); - } - - - /** - * tests validate() - */ - public function testValidate(): void - { - $rule = $this->getMockBuilder(ValueInWhitelistRule::class) - ->disableOriginalConstructor() - ->onlyMethods(["getWhitelist", "isParameterValueValid"]) - ->getMock(); - $validate = $this->makeAccessible($rule, "validate"); - - $errors = new ValidationErrors(); - - $parameter = $this->getMockBuilder(Parameter::class) - ->disableOriginalConstructor() - ->onlyMethods(["getName", "getValue"]) - ->getMock(); - - $validValues = ["include", "MailAccount", "MailFolder"]; - $invalidValues = ["include", "MailAccount", "MessageItem"]; - - $value = "MailFolder"; - - $rule->expects($this->exactly(2)) - ->method("getWhitelist") - ->willReturnOnConsecutiveCalls($validValues, $invalidValues); - - $rule->expects($this->exactly(2)) - ->method("isParameterValueValid") - ->withConsecutive([$parameter, $validValues], [$parameter, $invalidValues]) - ->willReturnOnConsecutiveCalls(true, false); - - $parameter->expects($this->exactly(1)) - ->method("getValue") - ->willReturn( - $value - ); - $parameter->expects($this->once()) - ->method("getName") - ->willReturn("parameter"); - - $this->assertTrue( - $validate->invokeArgs($rule, [$parameter, $errors]) - ); - $this->assertFalse($errors->hasError()); - $this->assertFalse( - $validate->invokeArgs($rule, [$parameter, $errors]) - ); - $this->assertTrue($errors->hasError()); - - /** - * @var ValidationError $err - */ - $err = $errors[0]; - $this->assertStringContainsString( - "parameter \"parameter\"'s value must validate against", - $err->getDetails() - ); - $this->assertSame(400, $err->getCode()); - $this->assertSame($parameter, $err->getSource()); - } -} diff --git a/tests/Web/Validation/Parameter/Rule/ValuesInWhitelistRuleTest.php b/tests/Web/Validation/Parameter/Rule/ValuesInWhitelistRuleTest.php deleted file mode 100644 index 8e1fd8d1..00000000 --- a/tests/Web/Validation/Parameter/Rule/ValuesInWhitelistRuleTest.php +++ /dev/null @@ -1,72 +0,0 @@ -assertInstanceOf(ValueInWhitelistRule::class, $rule); - } - - - /** - * tests isParameterValueValid() - */ - public function testIsParameterValueValid(): void - { - $whitelist = ["a", "b", "c"]; - - $rule = new ValuesInWhitelistRule("name", $whitelist); - $isParameterValueValid = $this->makeAccessible($rule, "isParameterValueValid"); - - $this->assertTrue($isParameterValueValid->invokeArgs( - $rule, - [new Parameter("name", "b,c"), $whitelist] - )); - - $this->assertFalse($isParameterValueValid->invokeArgs( - $rule, - [new Parameter("name", "b,c,d"), $whitelist] - )); - } -} diff --git a/tests/Web/Validation/Query/QueryRuleListTest.php b/tests/Web/Validation/Query/QueryRuleListTest.php deleted file mode 100644 index cac5eb81..00000000 --- a/tests/Web/Validation/Query/QueryRuleListTest.php +++ /dev/null @@ -1,64 +0,0 @@ -createList(); - $this->assertInstanceOf(AbstractList::class, $list); - - $this->assertSame(QueryRule::class, $list->getEntityType()); - } - - - /** - * @return QueryRuleList - */ - protected function createList(): QueryRuleList - { - $list = new QueryRuleList(); - - - return $list; - } -} diff --git a/tests/Web/Validation/Query/QueryRuleTest.php b/tests/Web/Validation/Query/QueryRuleTest.php deleted file mode 100644 index 23dc16ae..00000000 --- a/tests/Web/Validation/Query/QueryRuleTest.php +++ /dev/null @@ -1,106 +0,0 @@ -createMockForAbstract(QueryRule::class); - $this->assertInstanceOf(ValidationRule::class, $rule); - } - - - /** - * test supports() - */ - public function testSupports(): void - { - /** - * @var QueryRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(QueryRule::class); - - $this->assertTrue($rule->supports($this->createMockForAbstract(Query::class))); - $this->assertFalse($rule->supports(new stdClass())); - } - - - /** - * test isValid() throwing UnexpectedTypeException - */ - public function testisValidWithUnexpectedTypeException(): void - { - $obj = new stdClass(); - /** - * @var QueryRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(QueryRule::class, ["supports"]); - $rule->expects($this->once())->method("supports")->with($obj)->willReturn(false); - $this->expectException(UnexpectedTypeException::class); - - $rule->isValid($obj, new ValidationErrors()); - } - - /** - * test isValid() delegating to validate - */ - public function testIsValid(): void - { - $query = $this->getMockBuilder(Query::class)->disableOriginalConstructor()->getMock(); - $errors = new ValidationErrors(); - - /** - * @var QueryRule&MockObject $rule - */ - $rule = $this->createMockForAbstract(QueryRule::class, ["validate"]); - $rule->expects($this->once())->method("validate")->with($query, $errors)->willReturn(true); - - $this->assertSame(true, $rule->isValid($query, $errors)); - } -} diff --git a/tests/Web/Validation/Query/Rule/ExclusiveGroupKeyRuleTest.php b/tests/Web/Validation/Query/Rule/ExclusiveGroupKeyRuleTest.php deleted file mode 100644 index 056be4b4..00000000 --- a/tests/Web/Validation/Query/Rule/ExclusiveGroupKeyRuleTest.php +++ /dev/null @@ -1,109 +0,0 @@ -assertInstanceOf(QueryRule::class, $rule); - - $groups = $this->makeAccessible($rule, "groups", true); - - $this->assertEquals( - $cGroups, - $groups->getValue($rule) - ); - } - - - /** - * Test validation for this rule. - * - * @return void - */ - public function testIsValid(): void - { - $parameterListValid = new ParameterList(); - $parameterListValid[] = new Parameter("fields[MessageItem]", "subject"); - $parameterListValid[] = new Parameter("relfield:fields[MailFolder]", "+previewText"); - - $parameterListInvalid = new ParameterList(); - $parameterListInvalid[] = new Parameter("fields[MessageItem]", "subject"); - $parameterListInvalid[] = new Parameter("relfield:fields[MessageItem]", "+previewText"); - - $query = $this->createMockForAbstract(Query::class, ["getAllParameters"]); - $query->expects($this->exactly(2)) - ->method("getAllParameters") - ->willReturnOnConsecutiveCalls( - $parameterListInvalid, - $parameterListValid - ); - - $cGroups = ["fields", "relfield:fields"]; - - $rule = new ExclusiveGroupKeyRule($cGroups); - - $errors = new ValidationErrors(); - $this->assertFalse($rule->isValid($query, $errors)); - - /** - * @var ValidationError $err - */ - $err = $errors[0]; - - $this->assertStringContainsString( - "\"MessageItem\" must not appear in group \"relfield:fields\", since it was already " . - "configured with \"fields\"", - $err->getDetails() - ); - $this->assertTrue($rule->isValid($query, $errors)); - } -} diff --git a/tests/Web/Validation/Query/Rule/OnlyParameterNamesRuleTest.php b/tests/Web/Validation/Query/Rule/OnlyParameterNamesRuleTest.php deleted file mode 100644 index ebefdd77..00000000 --- a/tests/Web/Validation/Query/Rule/OnlyParameterNamesRuleTest.php +++ /dev/null @@ -1,112 +0,0 @@ -assertInstanceOf(QueryRule::class, $rule); - } - - public function testGetWhiteList(): void - { - $whitelist = ["include", "filter"]; - - $rule = new OnlyParameterNamesRule($whitelist); - $this->assertEquals($whitelist, $rule->getWhitelist()); - } - - - /** - * tests validate() - */ - public function testValidate(): void - { - $rule = $this->getMockBuilder(OnlyParameterNamesRule::class) - ->disableOriginalConstructor() - ->onlyMethods(["getWhiteList"]) - ->getMock(); - $validate = $this->makeAccessible($rule, "validate"); - - $errors = new ValidationErrors(); - - /** - * @var Query&MockObject $rule - */ - $query = $this->createMockForAbstract(Query::class, ["getAllParameterNames"]); - - $validParameterNames = ["include", "fields[MailAccount]", "fields[MailFolder]"]; - $invalidParameterNames = ["include", "fields[MailAccount]", "fields[MessageItem]"]; - - $parameterNames = ["include", "fields[MailAccount]", "fields[MailFolder]"]; - - $rule->expects($this->exactly(2)) - ->method("getWhitelist") - ->willReturnOnConsecutiveCalls($validParameterNames, $invalidParameterNames); - - $query->expects($this->exactly(2)) - ->method("getAllParameterNames") - ->willReturn( - $parameterNames - ); - - $this->assertTrue( - $validate->invokeArgs($rule, [$query, $errors]) - ); - $this->assertFalse($errors->hasError()); - $this->assertFalse( - $validate->invokeArgs($rule, [$query, $errors]) - ); - $this->assertTrue($errors->hasError()); - /** - * @var ValidationError $err - */ - $err = $errors[0]; - $this->assertStringContainsString("found additional parameters", $err->getDetails()); - $this->assertSame(400, $err->getCode()); - $this->assertSame($query, $err->getSource()); - } -} diff --git a/tests/Web/Validation/Query/Rule/RequiredParameterNamesRuleTest.php b/tests/Web/Validation/Query/Rule/RequiredParameterNamesRuleTest.php deleted file mode 100644 index 6c0de2a7..00000000 --- a/tests/Web/Validation/Query/Rule/RequiredParameterNamesRuleTest.php +++ /dev/null @@ -1,112 +0,0 @@ -assertInstanceOf(QueryRule::class, $rule); - } - - public function testGetRequired(): void - { - $required = ["include", "filter"]; - - $rule = new RequiredParameterNamesRule($required); - $this->assertEquals($required, $rule->getRequired()); - } - - - /** - * tests validate() - */ - public function testValidate(): void - { - $rule = $this->getMockBuilder(RequiredParameterNamesRule::class) - ->disableOriginalConstructor() - ->onlyMethods(["getRequired"]) - ->getMock(); - $validate = $this->makeAccessible($rule, "validate"); - - $errors = new ValidationErrors(); - - /** - * @var Query&MockObject $rule - */ - $query = $this->createMockForAbstract(Query::class, ["getAllParameterNames"]); - - $requiredOk = ["include", "sort"]; - $requiredFailure = ["include", "sort", "options"]; - - $parameterNames = ["include", "sort"]; - - $rule->expects($this->exactly(2)) - ->method("getRequired") - ->willReturnOnConsecutiveCalls($requiredOk, $requiredFailure); - - $query->expects($this->exactly(2)) - ->method("getAllParameterNames") - ->willReturn( - $parameterNames - ); - - $this->assertTrue( - $validate->invokeArgs($rule, [$query, $errors]) - ); - $this->assertFalse($errors->hasError()); - $this->assertFalse( - $validate->invokeArgs($rule, [$query, $errors]) - ); - $this->assertTrue($errors->hasError()); - /** - * @var ValidationError $err - */ - $err = $errors[0]; - $this->assertStringContainsString("required parameters missing", $err->getDetails()); - $this->assertSame(400, $err->getCode()); - $this->assertSame($query, $err->getSource()); - } -} diff --git a/tests/Web/Validation/QueryValidatorTest.php b/tests/Web/Validation/QueryValidatorTest.php deleted file mode 100644 index c79a23cc..00000000 --- a/tests/Web/Validation/QueryValidatorTest.php +++ /dev/null @@ -1,195 +0,0 @@ -createMockForAbstract(QueryValidator::class); - $this->assertInstanceOf(BaseValidator::class, $validator); - } - - - /** - * test supports() - */ - public function testSupports(): void - { - /** - * @var MockObject&QueryValidator $validator - */ - $validator = $this->createMockForAbstract(QueryValidator::class); - - $this->assertTrue( - $validator->supports( - $this->getMockBuilder(Query::class)->disableOriginalConstructor()->getMock() - ) - ); - } - - - /** - * tests validate() with parameter not of type JsonApi\Query\Query - */ - public function testValidateWithUnexpectedTypeException(): void - { - $this->expectException(UnexpectedTypeException::class); - /** - * @var MockObject&QueryValidator $validator - */ - $validator = $this->createMockForAbstract(QueryValidator::class); - - $validator->validate(new stdClass(), new ValidationErrors()); - } - - - /** - * tests validate() with supports() returning false - */ - public function testValidateWithUnexpectedQueryException(): void - { - $query = $this->getMockBuilder(Query::class)->disableOriginalConstructor()->getMock(); - $this->expectException(UnexpectedQueryException::class); - /** - * @var MockObject&QueryValidator $validator - */ - $validator = $this->createMockForAbstract(QueryValidator::class, ["supports"]); - $validator->expects($this->once())->method("supports")->with($query)->willReturn(false); - - $validator->validate($query, new ValidationErrors()); - } - - - - /** - * tests validate() - */ - public function testValidate(): void - { - $query = $this->createMockForAbstract(Query::class, ["getAllParameters"]); - $errors = new ValidationErrors(); - - $parameters = new ParameterList(); - $parameters[] = new Parameter("include", "MessageItem"); - $parameters[] = new Parameter("fields[MessageItem]", "subject"); - - $query->expects($this->once()) - ->method("getAllParameters") - ->willReturn($parameters); - - $queryRules = new QueryRuleList(); - /** - * @var MockObject&QueryRule $rule1 - */ - $rule1 = $this->createMockForAbstract(QueryRule::class, ["supports", "validate"]); - $queryRules[] = $rule1; - /** - * @var MockObject&QueryRule $rule2 - */ - $rule2 = $this->createMockForAbstract(QueryRule::class, ["supports", "validate"]); - $queryRules[] = $rule2; - - $parameterRules = new ParameterRuleList(); - /** - * @var MockObject&ParameterRule $parameterRule1 - */ - $parameterRule1 = $this->createMockForAbstract(ParameterRule::class, [ - "supports", "validate" - ]); - $parameterRules[] = $parameterRule1; - - /** - * @var MockObject&ParameterRule $parameterRule2 - */ - $parameterRule2 = $this->createMockForAbstract(ParameterRule::class, [ - "supports", "validate" - ]); - $parameterRules[] = $parameterRule2; - - /** - * @var MockObject&QueryValidator $validator - */ - $validator = $this->createMockForAbstract(QueryValidator::class, [ - "getQueryRules", - "getParameterRules" - ]); - - $validator->expects($this->once())->method("getQueryRules")->with($query)->willReturn($queryRules); - $validator->expects($this->once())->method("getParameterRules")->with($query)->willReturn($parameterRules); - - foreach ($queryRules as $queryRule) { - /** - * @var MockObject&QueryRule $queryRule - */ - $queryRule->expects($this->once())->method("validate")->with($query, $errors)->willReturn(true); - $queryRule->expects($this->once())->method("supports")->with($query)->willReturn(true); - } - - foreach ($parameterRules as $parameterRule) { - /** - * @var MockObject&ParameterRule $parameterRule - */ - $parameterRule->expects($this->exactly(3)) - ->method("supports") - ->withConsecutive([$parameters[0]], [$parameters[0]], [$parameters[1]]) - ->willReturnOnConsecutiveCalls(true, true, false); - - $parameterRule->expects($this->exactly(1)) - ->method("validate") - ->with($parameters[0], $errors) - ->willReturn(true); - } - - $validator->validate($query, $errors); - } -}