diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index d5b6a57f1..5bfa33419 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -17,5 +17,6 @@
->notPath('l10n')
->notPath('src')
->notPath('vendor')
+ ->notPath('tests/stubs')
->in(__DIR__);
return $config;
diff --git a/LICENSES/AGPL-3.0-only.txt b/LICENSES/AGPL-3.0-only.txt
new file mode 100644
index 000000000..0c97efd25
--- /dev/null
+++ b/LICENSES/AGPL-3.0-only.txt
@@ -0,0 +1,235 @@
+GNU AFFERO GENERAL PUBLIC LICENSE
+Version 3, 19 November 2007
+
+Copyright (C) 2007 Free Software Foundation, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+ Preamble
+
+The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
+
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
+
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+ TERMS AND CONDITIONS
+
+0. Definitions.
+
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+
+ d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License.
+
+Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
+
+14. Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
+
+You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see .
diff --git a/REUSE.toml b/REUSE.toml
index 391f5d954..48c072627 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -40,3 +40,21 @@ path = ["img/circles-dark.svg", "img/circles.svg"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2018-2024 Google LLC"
SPDX-License-Identifier = "Apache-2.0"
+
+[[annotations]]
+path = ["tests/stubs/doctrine_dbal_**"]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "none"
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = ["tests/stubs/symfony_component_**"]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "none"
+SPDX-License-Identifier = "MIT"
+
+[[annotations]]
+path = ["tests/stubs/stecman_component_**"]
+precedence = "aggregate"
+SPDX-FileCopyrightText = "none"
+SPDX-License-Identifier = "MIT"
diff --git a/composer.json b/composer.json
index cbb1c747d..56c133331 100644
--- a/composer.json
+++ b/composer.json
@@ -25,19 +25,19 @@
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
- "psalm": "psalm.phar --threads=1 --update-baseline",
- "psalm:update-baseline": "psalm.phar --threads=1 --update-baseline",
+ "psalm": "psalm.phar --threads=1 --no-cache",
+ "psalm:update-baseline": "psalm.phar --threads=1 --no-cache --update-baseline",
"psalm:clear": "psalm.phar --clear-cache && psalm.phar --clear-global-cache",
"psalm:fix": "psalm.phar --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"test": [
"@test:unit"
],
"test:unit": "vendor/bin/phpunit -c tests/phpunit.xml",
- "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
+ "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './tests/stubs/*' -print0 | xargs -0 -n1 php -l"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
- "psalm/phar": "^5.22",
+ "psalm/phar": "^6.7",
"nextcloud/ocp": "dev-master",
"nextcloud/coding-standard": "^1.2"
}
diff --git a/composer.lock b/composer.lock
index 8000d9f2f..1b9b2f09a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "b42a6fd7d0d9fd93ba90bd6f0cb4dc0e",
+ "content-hash": "1545f7bfbd997db4cf6df7e9cde711bd",
"packages": [],
"packages-dev": [
{
@@ -852,16 +852,16 @@
},
{
"name": "psalm/phar",
- "version": "5.26.1",
+ "version": "6.7.1",
"source": {
"type": "git",
"url": "https://github.com/psalm/phar.git",
- "reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547"
+ "reference": "a7112d33cfd48d857c2eb730ea642046d21bbdf5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/psalm/phar/zipball/8a38e7ad04499a0ccd2c506fd1da6fc01fff4547",
- "reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547",
+ "url": "https://api.github.com/repos/psalm/phar/zipball/a7112d33cfd48d857c2eb730ea642046d21bbdf5",
+ "reference": "a7112d33cfd48d857c2eb730ea642046d21bbdf5",
"shasum": ""
},
"require": {
@@ -881,9 +881,9 @@
"description": "Composer-based Psalm Phar",
"support": {
"issues": "https://github.com/psalm/phar/issues",
- "source": "https://github.com/psalm/phar/tree/5.26.1"
+ "source": "https://github.com/psalm/phar/tree/6.7.1"
},
- "time": "2024-09-09T16:22:43+00:00"
+ "time": "2025-02-17T10:54:35+00:00"
},
{
"name": "psr/clock",
@@ -2060,8 +2060,8 @@
},
"prefer-stable": false,
"prefer-lowest": false,
- "platform": [],
- "platform-dev": [],
+ "platform": {},
+ "platform-dev": {},
"platform-overrides": {
"php": "8.1"
},
diff --git a/lib/CirclesQueryHelper.php b/lib/CirclesQueryHelper.php
index b18ffcb4c..1e8b95dff 100644
--- a/lib/CirclesQueryHelper.php
+++ b/lib/CirclesQueryHelper.php
@@ -31,7 +31,7 @@ class CirclesQueryHelper {
/** @var CoreRequestBuilder */
private $coreRequestBuilder;
- /** @var CoreQueryBuilder */
+ /** @var CoreQueryBuilder&IQueryBuilder */
private $queryBuilder;
/** @var FederatedUserService */
@@ -54,9 +54,9 @@ public function __construct(
/**
- * @return IQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
- public function getQueryBuilder(): IQueryBuilder {
+ public function getQueryBuilder(): CoreQueryBuilder {
$this->queryBuilder = $this->coreRequestBuilder->getQueryBuilder();
return $this->queryBuilder;
diff --git a/lib/Command/CirclesCheck.php b/lib/Command/CirclesCheck.php
index efd171fed..a32fe0220 100644
--- a/lib/Command/CirclesCheck.php
+++ b/lib/Command/CirclesCheck.php
@@ -39,6 +39,7 @@
use OCA\Circles\Tools\Traits\TNCRequest;
use OCA\Circles\Tools\Traits\TStringTools;
use OCP\IAppConfig;
+use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -181,6 +182,7 @@ private function checkLoopback(InputInterface $input, OutputInterface $output, s
$output->writeln('- You do not have a valid loopback address setup right now.');
$output->writeln('');
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
while (true) {
$question = new Question('Please write down a new loopback address to test: ', '');
@@ -265,13 +267,13 @@ private function testLoopback(InputInterface $input, OutputInterface $output): b
return false;
}
- $timer = round(microtime(true) * 1000);
+ $timer = round(microtime(true) * 1000.0);
$output->write('- Creating async FederatedEvent ');
$test = new FederatedEvent(LoopbackTest::class);
$this->federatedEventService->newEvent($test);
$output->writeln(
'' . $test->getWrapperToken() . ' ' .
- '(took ' . (round(microtime(true) * 1000) - $timer) . 'ms)'
+ '(took ' . ((string)(round(microtime(true) * 1000.0) - $timer)) . 'ms)'
);
$output->writeln('- Waiting for async process to finish (5s)');
@@ -290,18 +292,18 @@ private function testLoopback(InputInterface $input, OutputInterface $output): b
$checkVerify = $wrapper->getEvent()->getData()->gInt('verify');
if ($checkVerify === LoopbackTest::VERIFY) {
- $output->write('verify=' . $checkVerify . ' ');
+ $output->write('verify=' . ((string)$checkVerify) . ' ');
} else {
- $output->writeln('verify=' . $checkVerify . '');
+ $output->writeln('verify=' . ((string)$checkVerify) . '');
return false;
}
$checkManage = $wrapper->getResult()->gInt('manage');
if ($checkManage === LoopbackTest::MANAGE) {
- $output->write('manage=' . $checkManage . ' ');
+ $output->write('manage=' . ((string)$checkManage) . ' ');
} else {
- $output->writeln('manage=' . $checkManage . '');
+ $output->writeln('manage=' . ((string)$checkManage) . '');
return false;
}
@@ -328,6 +330,7 @@ private function saveLoopback(InputInterface $input, OutputInterface $output, st
false, '/^(y|Y)/i'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('skipping.');
@@ -364,6 +367,7 @@ private function checkInternal(InputInterface $input, OutputInterface $output, s
'- Do you want to enable this feature ? (y/N) ', false, '/^(y|Y)/i'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('skipping.');
@@ -508,6 +512,7 @@ private function saveInternal(InputInterface $input, OutputInterface $output, st
false, '/^(y|Y)/i'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('skipping.');
@@ -543,6 +548,7 @@ private function checkFrontal(InputInterface $input, OutputInterface $output, st
'- Do you want to enable this feature ? (y/N) ', false, '/^(y|Y)/i'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('skipping.');
@@ -686,6 +692,7 @@ private function saveFrontal(InputInterface $input, OutputInterface $output, str
false, '/^(y|Y)/i'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('skipping.');
@@ -733,7 +740,7 @@ private function testRequest(
$color = 'info';
}
- $output->writeln('<' . $color . '>' . $result->getStatusCode() . '' . $color . '>');
+ $output->writeln('<' . $color . '>' . ((string)$result->getStatusCode()) . '' . $color . '>');
if ($result->getStatusCode() === 200) {
return true;
}
@@ -759,6 +766,7 @@ private function saveUrl(InputInterface $input, OutputInterface $output, string
'The address ' . $address . ' seems to reach your local Nextcloud.'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$output->writeln('');
$question = new ConfirmationQuestion(
@@ -801,7 +809,7 @@ private function parseAddress(string $test): array {
$path = rtrim($path, '/');
if (!is_null($cloudIdPort)) {
- $cloudId = $cloudId . ':' . $cloudIdPort;
+ $cloudId = $cloudId . ':' . ((string)$cloudIdPort);
}
return [$scheme, $cloudId, $path];
diff --git a/lib/Command/CirclesConfig.php b/lib/Command/CirclesConfig.php
index a0024ec04..9253e4949 100644
--- a/lib/Command/CirclesConfig.php
+++ b/lib/Command/CirclesConfig.php
@@ -116,7 +116,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesCreate.php b/lib/Command/CirclesCreate.php
index 3f591368b..65dbfd696 100644
--- a/lib/Command/CirclesCreate.php
+++ b/lib/Command/CirclesCreate.php
@@ -104,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesDestroy.php b/lib/Command/CirclesDestroy.php
index 3d3a451f6..1fbce6842 100644
--- a/lib/Command/CirclesDestroy.php
+++ b/lib/Command/CirclesDestroy.php
@@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesDetails.php b/lib/Command/CirclesDetails.php
index 2aec229b8..7bcefba66 100644
--- a/lib/Command/CirclesDetails.php
+++ b/lib/Command/CirclesDetails.php
@@ -158,7 +158,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesEdit.php b/lib/Command/CirclesEdit.php
index c3a391fd4..3d261fc27 100644
--- a/lib/Command/CirclesEdit.php
+++ b/lib/Command/CirclesEdit.php
@@ -100,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesJoin.php b/lib/Command/CirclesJoin.php
index d28855f4b..6076f7696 100644
--- a/lib/Command/CirclesJoin.php
+++ b/lib/Command/CirclesJoin.php
@@ -119,7 +119,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesLeave.php b/lib/Command/CirclesLeave.php
index 31f6d9b89..fd63964a1 100644
--- a/lib/Command/CirclesLeave.php
+++ b/lib/Command/CirclesLeave.php
@@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesList.php b/lib/Command/CirclesList.php
index 966409ac6..6df5cc5d8 100644
--- a/lib/Command/CirclesList.php
+++ b/lib/Command/CirclesList.php
@@ -237,9 +237,9 @@ private function displayCircles(array $circles): void {
Circle::$DEF_SOURCE[$circle->getSource()],
$this->cut($displayName ? $owner->getDisplayName() : $owner->getUserId(), 40),
$this->configService->displayInstance($owner->getInstance()),
- $circle->getPopulation() . '/'
- . $this->getInt('members_limit', $circle->getSettings(), -1)
- . ' (' . $circle->getPopulationInherited() . ')'
+ ((string)$circle->getPopulation()) . '/'
+ . ((string)$this->getInt('members_limit', $circle->getSettings(), -1))
+ . ' (' . ((string)$circle->getPopulationInherited()) . ')'
]
);
}
diff --git a/lib/Command/CirclesMaintenance.php b/lib/Command/CirclesMaintenance.php
index 31c517b2a..e00c366cf 100644
--- a/lib/Command/CirclesMaintenance.php
+++ b/lib/Command/CirclesMaintenance.php
@@ -16,6 +16,7 @@
use OCA\Circles\Service\MaintenanceService;
use OCA\Circles\Service\OutputService;
use OCP\IDBConnection;
+use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -92,6 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'/^(y|Y)/i'
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
$output->writeln('aborted.');
@@ -107,6 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
. '\': ', ''
);
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$confirmation = $helper->ask($input, $output, $question);
if (strtolower($confirmation) !== $action) {
diff --git a/lib/Command/CirclesMemberships.php b/lib/Command/CirclesMemberships.php
index 739a5dd9a..924bd12a8 100644
--- a/lib/Command/CirclesMemberships.php
+++ b/lib/Command/CirclesMemberships.php
@@ -204,7 +204,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($count === 0) {
$output->writeln('(database not updated)');
} else {
- $output->writeln('(' . $count . ' entries generated/updated in the database)');
+ $output->writeln('(' . ((string)$count) . ' entries generated/updated in the database)');
}
foreach ($federatedUser->getMemberships() as $membership) {
@@ -379,6 +379,6 @@ private function manageAllMemberships() {
);
}
- $output->writeln($count . ' memberships updated');
+ $output->writeln(((string)$count) . ' memberships updated');
}
}
diff --git a/lib/Command/CirclesRemote.php b/lib/Command/CirclesRemote.php
index 3c10f6259..1c20634fc 100644
--- a/lib/Command/CirclesRemote.php
+++ b/lib/Command/CirclesRemote.php
@@ -29,6 +29,7 @@
use OCA\Circles\Tools\Model\NCSignedRequest;
use OCA\Circles\Tools\Traits\TNCWellKnown;
use OCA\Circles\Tools\Traits\TStringTools;
+use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -246,7 +247,7 @@ private function requestInstance(string $host): void {
$result = $signedRequest->getOutgoingRequest()->getResult();
$code = $result->getStatusCode();
- $this->output->writeln(' * Result: ' . (($code === 200) ? '' . $code . '' : $code));
+ $this->output->writeln(' * Result: ' . (($code === 200) ? '' . ((string)$code) . '' : $code));
$this->output->writeln(
json_encode(json_decode($result->getContent(), true), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
);
@@ -318,6 +319,7 @@ private function requestInstance(string $host): void {
*/
private function saveRemote(RemoteInstance $remoteSignatory) {
$this->output->writeln('');
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$this->output->writeln(
@@ -349,6 +351,7 @@ private function saveRemote(RemoteInstance $remoteSignatory) {
*/
private function updateRemote(RemoteInstance $remoteSignatory): void {
$this->output->writeln('');
+ /** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$this->output->writeln(
diff --git a/lib/Command/CirclesSetting.php b/lib/Command/CirclesSetting.php
index 5786c4b97..34609dd57 100644
--- a/lib/Command/CirclesSetting.php
+++ b/lib/Command/CirclesSetting.php
@@ -129,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/CirclesTest.php b/lib/Command/CirclesTest.php
index a2406af1d..6e567ed74 100644
--- a/lib/Command/CirclesTest.php
+++ b/lib/Command/CirclesTest.php
@@ -544,7 +544,7 @@ private function statusFreshInstances() {
$expectedSize = sizeof($this->getConfigArray($instanceId, 'groups'))
+ sizeof($this->getConfigArray($instanceId, 'users'))
+ 1;
- $this->r((sizeof($result) === $expectedSize), sizeof($result) . ' circles');
+ $this->r((sizeof($result) === $expectedSize), ((string)sizeof($result)) . ' circles');
$membersList = $groupsList = [];
foreach ($result as $item) {
@@ -947,29 +947,22 @@ private function confirmCircleData(
if ($compareTo->hasOwner()) {
$compareToOwner = $compareTo->getOwner();
- if ($compareToOwner !== null) {
- $owner = $circle->getOwner();
- if ($owner === null) {
- throw new Exception('empty owner');
- }
- if ($owner->getCircleId() !== $circle->getSingleId()) {
- throw new Exception($prefix . '.owner.circleId is different than ' . $prefix . '.id');
- }
- $this->confirmMemberData($owner, $compareToOwner, 'owner', false, $params);
+ $owner = $circle->getOwner();
+ if ($owner->getCircleId() !== $circle->getSingleId()) {
+ throw new Exception($prefix . '.owner.circleId is different than ' . $prefix . '.id');
}
+ $this->confirmMemberData($owner, $compareToOwner, 'owner', false, $params);
}
if ($compareTo->hasInitiator()) {
$compareToInitiator = $compareTo->getInitiator();
- if ($compareToInitiator !== null) {
- if (!$circle->hasInitiator()) {
- throw new Exception('empty initiator');
- }
- $initiator = $circle->getInitiator();
- if ($initiator->getCircleId() !== $circle->getSingleId()) {
- throw new Exception($prefix . '.initiator.circleId is different than ' . $prefix . '.id');
- }
- $this->confirmMemberData($initiator, $compareToInitiator, 'owner', false, $params);
+ if (!$circle->hasInitiator()) {
+ throw new Exception('empty initiator');
+ }
+ $initiator = $circle->getInitiator();
+ if ($initiator->getCircleId() !== $circle->getSingleId()) {
+ throw new Exception($prefix . '.initiator.circleId is different than ' . $prefix . '.id');
}
+ $this->confirmMemberData($initiator, $compareToInitiator, 'owner', false, $params);
}
if ($versa) {
@@ -1048,7 +1041,7 @@ private function compare(string $expected, string $compare, string $def, array $
private function compareInt(int $expected, int $compare, string $def, bool $force = false) {
if (($expected > 0 || ($force && $expected >= 0))
&& $expected !== $compare) {
- throw new Exception('wrong ' . $def . ': ' . $compare . ' (' . $expected . ')');
+ throw new Exception('wrong ' . $def . ': ' . ((string)$compare) . ' (' . ((string)$expected) . ')');
}
}
@@ -1144,7 +1137,7 @@ private function getConfig(string $instance, string $key): string {
* @param string $instance
* @param string $key
*
- * @return array
+ * @return array
* @throws ItemNotFoundException
*/
private function getConfigArray(string $instance, string $key): array {
diff --git a/lib/Command/MembersAdd.php b/lib/Command/MembersAdd.php
index 2e24341bd..08d11327f 100644
--- a/lib/Command/MembersAdd.php
+++ b/lib/Command/MembersAdd.php
@@ -109,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/MembersLevel.php b/lib/Command/MembersLevel.php
index f2c50669b..e320a0a83 100644
--- a/lib/Command/MembersLevel.php
+++ b/lib/Command/MembersLevel.php
@@ -133,7 +133,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} catch (FederatedItemException $e) {
if ($input->getOption('status-code')) {
throw new FederatedItemException(
- ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
+ ' [' . get_class($e) . ', ' . ((string)$e->getStatus()) . ']' . "\n" . $e->getMessage()
);
}
diff --git a/lib/Command/MembersList.php b/lib/Command/MembersList.php
index 1e23ce60e..36c45b2bf 100644
--- a/lib/Command/MembersList.php
+++ b/lib/Command/MembersList.php
@@ -258,7 +258,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
* @param TreeNode|null $tree
* @param array $knownIds
*
- * @return array
+ * @return list
* @throws CircleNotFoundException
* @throws FederatedItemException
* @throws FederatedUserException
@@ -391,9 +391,9 @@ public function displayLeaf(SimpleDataStore $data, int $lineNumber): string {
$line = '';
$circle = null;
if ($data->hasKey('circle')) {
- /** @var Circle $circle */
try {
$circle = $data->gObj('circle', Circle::class);
+ /** @var Circle $circle */
} catch (Exception $e) {
}
}
diff --git a/lib/Command/MigrateCustomGroups.php b/lib/Command/MigrateCustomGroups.php
index 408be3e4c..831fb2f7f 100644
--- a/lib/Command/MigrateCustomGroups.php
+++ b/lib/Command/MigrateCustomGroups.php
@@ -158,7 +158,7 @@ public function updateShares(string $groupUri, string $circleId, array $memberId
->where($update->expr()->in('id', $update->createNamedParameter($shareIds, IQueryBuilder::PARAM_INT_ARRAY)));
$count = $update->executeStatement();
- $this->output->writeln('> ' . $count . ' shares updated');
+ $this->output->writeln('> ' . ((string)$count) . ' shares updated');
$this->fixShareChildren($shareIds, $memberIds);
}
@@ -198,7 +198,7 @@ private function fixShareChildren(array $shareIds, array $memberIds): void {
$count += $update->executeStatement();
}
- $this->output->writeln('> ' . $count . ' children shares updated');
+ $this->output->writeln('> ' . ((string)$count) . ' children shares updated');
}
diff --git a/lib/Db/CircleRequest.php b/lib/Db/CircleRequest.php
index d3192e8bb..8b2c8162c 100644
--- a/lib/Db/CircleRequest.php
+++ b/lib/Db/CircleRequest.php
@@ -23,6 +23,7 @@
use OCA\Circles\Model\Member;
use OCA\Circles\Model\Probes\CircleProbe;
use OCA\Circles\Model\Probes\DataProbe;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class CircleRequest
@@ -239,7 +240,7 @@ public function probeCircles(
* @param CircleProbe $circleProbe
* @param DataProbe $dataProbe
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
* @throws RequestBuilderException
*/
private function buildProbeCircle(
diff --git a/lib/Db/CircleRequestBuilder.php b/lib/Db/CircleRequestBuilder.php
index bf65196f1..644ba62c7 100644
--- a/lib/Db/CircleRequestBuilder.php
+++ b/lib/Db/CircleRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\CircleNotFoundException;
use OCA\Circles\Model\Circle;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class CircleRequestBuilder
@@ -22,7 +23,7 @@
*/
class CircleRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getCircleInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -34,7 +35,7 @@ protected function getCircleInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getCircleUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -48,7 +49,7 @@ protected function getCircleUpdateSql(): CoreQueryBuilder {
* @param string $alias
* @param bool $single
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getCircleSelectSql(
string $alias = CoreQueryBuilder::CIRCLE,
@@ -68,7 +69,7 @@ protected function getCircleSelectSql(
/**
* Base of the Sql Delete request
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getCircleDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -79,7 +80,7 @@ protected function getCircleDeleteSql(): CoreQueryBuilder {
/**
- * @param CoreQueryBuilder $qb
+ * @param CoreQueryBuilder&IQueryBuilder $qb
*
* @return Circle
* @throws CircleNotFoundException
diff --git a/lib/Db/CoreQueryBuilder.php b/lib/Db/CoreQueryBuilder.php
index fa64006b2..2a83d8859 100644
--- a/lib/Db/CoreQueryBuilder.php
+++ b/lib/Db/CoreQueryBuilder.php
@@ -1551,7 +1551,7 @@ public function leftJoinMountpoint(string $aliasMount, IFederatedUser $federated
* @param string $alias
* @param array $default
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
private function generateCircleSelectAlias(string $alias, array $default = []): self {
$this->generateSelectAlias(
@@ -1627,7 +1627,7 @@ private function generateRemoteInstanceSelectAlias(string $alias, array $default
* @param array $path
* @param array $options
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
public function setOptions(array $path, array $options): self {
$options = [self::OPTIONS => $options];
diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php
index d16e45670..96c90e5a1 100644
--- a/lib/Db/CoreRequestBuilder.php
+++ b/lib/Db/CoreRequestBuilder.php
@@ -17,6 +17,7 @@
use OCA\Circles\Exceptions\InvalidIdException;
use OCA\Circles\Service\ConfigService;
use OCA\Circles\Service\TimezoneService;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Share\IShare;
/**
@@ -199,10 +200,12 @@ public function __construct(TimezoneService $timezoneService, ConfigService $con
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
public function getQueryBuilder(): CoreQueryBuilder {
- return new CoreQueryBuilder();
+ /** @var CoreQueryBuilder&IQueryBuilder $qb */
+ $qb = new CoreQueryBuilder();
+ return $qb;
}
diff --git a/lib/Db/EventWrapperRequestBuilder.php b/lib/Db/EventWrapperRequestBuilder.php
index 54ba2f398..40e451f5b 100644
--- a/lib/Db/EventWrapperRequestBuilder.php
+++ b/lib/Db/EventWrapperRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\EventWrapperNotFoundException;
use OCA\Circles\Model\Federated\EventWrapper;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class GSEventsRequestBuilder
@@ -22,7 +23,7 @@
*/
class EventWrapperRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getEventWrapperInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -33,7 +34,7 @@ protected function getEventWrapperInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getEventWrapperUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -44,7 +45,7 @@ protected function getEventWrapperUpdateSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getEventWrapperSelectSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -60,7 +61,7 @@ protected function getEventWrapperSelectSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getEventWrapperDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/MemberRequestBuilder.php b/lib/Db/MemberRequestBuilder.php
index 4051d82f9..716ec83f3 100644
--- a/lib/Db/MemberRequestBuilder.php
+++ b/lib/Db/MemberRequestBuilder.php
@@ -17,6 +17,7 @@
use OCA\Circles\Model\FederatedUser;
use OCA\Circles\Model\Member;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class MemberRequestBuilder
@@ -25,7 +26,7 @@
*/
class MemberRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMemberInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -37,7 +38,7 @@ protected function getMemberInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMemberUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -51,7 +52,7 @@ protected function getMemberUpdateSql(): CoreQueryBuilder {
* @param IFederatedUser|null $initiator
* @param bool $getBasedOn
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
* @throws RequestBuilderException
*/
protected function getMemberSelectSql(
@@ -77,7 +78,7 @@ protected function getMemberSelectSql(
/**
* Base of the Sql Delete request
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMemberDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/MembershipRequestBuilder.php b/lib/Db/MembershipRequestBuilder.php
index 2e3480353..0b69df5c2 100644
--- a/lib/Db/MembershipRequestBuilder.php
+++ b/lib/Db/MembershipRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\MembershipNotFoundException;
use OCA\Circles\Model\Membership;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class MembershipRequestBuilder
@@ -22,7 +23,7 @@
*/
class MembershipRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMembershipInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -33,7 +34,7 @@ protected function getMembershipInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMembershipUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -44,7 +45,7 @@ protected function getMembershipUpdateSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMembershipSelectSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -61,7 +62,7 @@ protected function getMembershipSelectSql(): CoreQueryBuilder {
/**
* Base of the Sql Delete request
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMembershipDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/MountPointRequestBuilder.php b/lib/Db/MountPointRequestBuilder.php
index 4a0b8485e..f9181fcad 100644
--- a/lib/Db/MountPointRequestBuilder.php
+++ b/lib/Db/MountPointRequestBuilder.php
@@ -13,8 +13,12 @@
use OCA\Circles\Model\Mount;
use OCA\Circles\Model\Mountpoint;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
class MountPointRequestBuilder extends CoreRequestBuilder {
+ /**
+ * @return CoreQueryBuilder&IQueryBuilder
+ */
protected function getMountPointInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
$qb->insert(self::TABLE_MOUNTPOINT);
@@ -22,6 +26,9 @@ protected function getMountPointInsertSql(): CoreQueryBuilder {
return $qb;
}
+ /**
+ * @return CoreQueryBuilder&IQueryBuilder
+ */
protected function getMountPointUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
$qb->update(self::TABLE_MOUNTPOINT);
@@ -29,6 +36,9 @@ protected function getMountPointUpdateSql(): CoreQueryBuilder {
return $qb;
}
+ /**
+ * @return CoreQueryBuilder&IQueryBuilder
+ */
protected function getMountPointSelectSql(string $alias = CoreQueryBuilder::MOUNTPOINT): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
$qb->generateSelect(self::TABLE_MOUNTPOINT, self::$tables[self::TABLE_MOUNTPOINT], $alias);
@@ -36,6 +46,9 @@ protected function getMountPointSelectSql(string $alias = CoreQueryBuilder::MOUN
return $qb;
}
+ /**
+ * @return CoreQueryBuilder&IQueryBuilder
+ */
protected function getMountPointDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
$qb->delete(self::TABLE_MOUNTPOINT);
diff --git a/lib/Db/MountRequestBuilder.php b/lib/Db/MountRequestBuilder.php
index 20327b200..c0a0f180c 100644
--- a/lib/Db/MountRequestBuilder.php
+++ b/lib/Db/MountRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\MountNotFoundException;
use OCA\Circles\Model\Mount;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class MountRequestBuilder
@@ -22,7 +23,7 @@
*/
class MountRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMountInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -33,7 +34,7 @@ protected function getMountInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMountUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -46,7 +47,7 @@ protected function getMountUpdateSql(): CoreQueryBuilder {
/**
* @param string $alias
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMountSelectSql(string $alias = CoreQueryBuilder::MOUNT): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -57,7 +58,7 @@ protected function getMountSelectSql(string $alias = CoreQueryBuilder::MOUNT): C
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getMountDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/RemoteRequestBuilder.php b/lib/Db/RemoteRequestBuilder.php
index 692e400dd..c26d3e2a2 100644
--- a/lib/Db/RemoteRequestBuilder.php
+++ b/lib/Db/RemoteRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\RemoteNotFoundException;
use OCA\Circles\Model\Federated\RemoteInstance;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class RemoteRequestBuilder
@@ -22,7 +23,7 @@
*/
class RemoteRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getRemoteInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -36,7 +37,7 @@ protected function getRemoteInsertSql(): CoreQueryBuilder {
/**
* Base of the Sql Update request for Groups
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getRemoteUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -49,7 +50,7 @@ protected function getRemoteUpdateSql(): CoreQueryBuilder {
/**
* @param string $alias
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getRemoteSelectSql(string $alias = CoreQueryBuilder::REMOTE): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -62,7 +63,7 @@ protected function getRemoteSelectSql(string $alias = CoreQueryBuilder::REMOTE):
/**
* Base of the Sql Delete request
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getRemoteDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/ShareLockRequestBuilder.php b/lib/Db/ShareLockRequestBuilder.php
index 3c0d80a8b..a9d31592f 100644
--- a/lib/Db/ShareLockRequestBuilder.php
+++ b/lib/Db/ShareLockRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\FederatedShareNotFoundException;
use OCA\Circles\Model\Federated\FederatedShare;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class ShareRequestBuilder
@@ -22,7 +23,7 @@
*/
class ShareLockRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareLockInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -33,7 +34,7 @@ protected function getShareLockInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareLockSelectSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -47,7 +48,7 @@ protected function getShareLockSelectSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareLockUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -58,7 +59,7 @@ protected function getShareLockUpdateSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/ShareTokenRequestBuilder.php b/lib/Db/ShareTokenRequestBuilder.php
index 5b88f8f0f..6e698b470 100644
--- a/lib/Db/ShareTokenRequestBuilder.php
+++ b/lib/Db/ShareTokenRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\ShareTokenNotFoundException;
use OCA\Circles\Model\ShareToken;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
/**
* Class ShareTokenRequestBuilder
@@ -22,7 +23,7 @@
*/
class ShareTokenRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getTokenInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -33,7 +34,7 @@ protected function getTokenInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getTokenUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -46,7 +47,7 @@ protected function getTokenUpdateSql(): CoreQueryBuilder {
/**
* @param string $alias
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getTokenSelectSql(string $alias = CoreQueryBuilder::TOKEN): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -59,7 +60,7 @@ protected function getTokenSelectSql(string $alias = CoreQueryBuilder::TOKEN): C
/**
* Base of the Sql Delete request
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getTokenDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/Db/ShareWrapperRequest.php b/lib/Db/ShareWrapperRequest.php
index 41e6a493f..b2fbbd5bf 100644
--- a/lib/Db/ShareWrapperRequest.php
+++ b/lib/Db/ShareWrapperRequest.php
@@ -54,7 +54,7 @@ public function save(IShare $share, int $parentId = 0): int {
->setValue('password', $qb->createNamedParameter(''))
->setValue('permissions', $qb->createNamedParameter($share->getPermissions()))
->setValue('token', $qb->createNamedParameter($share->getToken()))
- ->setValue('stime', $qb->createFunction('UNIX_TIMESTAMP()'));
+ ->setValue('stime', (string)$qb->createFunction('UNIX_TIMESTAMP()'));
if ($parentId > 0) {
$qb->setValue('parent', $qb->createNamedParameter($parentId));
diff --git a/lib/Db/ShareWrapperRequestBuilder.php b/lib/Db/ShareWrapperRequestBuilder.php
index 32eb29bfa..e41479efe 100644
--- a/lib/Db/ShareWrapperRequestBuilder.php
+++ b/lib/Db/ShareWrapperRequestBuilder.php
@@ -14,6 +14,7 @@
use OCA\Circles\Exceptions\ShareWrapperNotFoundException;
use OCA\Circles\Model\ShareWrapper;
use OCA\Circles\Tools\Exceptions\RowNotFoundException;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Share\IShare;
/**
@@ -23,7 +24,7 @@
*/
class ShareWrapperRequestBuilder extends CoreRequestBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareInsertSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -34,7 +35,7 @@ protected function getShareInsertSql(): CoreQueryBuilder {
/**
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareUpdateSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -47,7 +48,7 @@ protected function getShareUpdateSql(): CoreQueryBuilder {
/**
* @param string $alias
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareSelectSql(string $alias = CoreQueryBuilder::SHARE): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
@@ -61,7 +62,7 @@ protected function getShareSelectSql(string $alias = CoreQueryBuilder::SHARE): C
/**
* Base of the Sql Delete request
*
- * @return CoreQueryBuilder
+ * @return CoreQueryBuilder&IQueryBuilder
*/
protected function getShareDeleteSql(): CoreQueryBuilder {
$qb = $this->getQueryBuilder();
diff --git a/lib/IFederatedUser.php b/lib/IFederatedUser.php
index eecc24763..98a19856e 100644
--- a/lib/IFederatedUser.php
+++ b/lib/IFederatedUser.php
@@ -19,26 +19,61 @@
* @package OCA\Circles
*/
interface IFederatedUser extends IFederatedModel {
+ /**
+ * @param string $singleId
+ *
+ * @return self
+ */
+ public function setSingleId(string $singleId): self;
+
/**
* @return string
*/
public function getSingleId(): string;
+ /**
+ * @param string $userId
+ *
+ * @return self
+ */
+ public function setUserId(string $userId): self;
+
/**
* @return string
*/
public function getUserId(): string;
+ /**
+ * @param int $userType
+ *
+ * @return self
+ */
+ public function setUserType(int $userType): self;
+
/**
* @return int
*/
public function getUserType(): int;
+ /**
+ * @param string $displayName
+ *
+ * @return IFederatedUser
+ */
+ public function setDisplayName(string $displayName): self;
+
/**
* @return string
*/
public function getDisplayName(): string;
+ /**
+ * @param ?Circle $basedOn
+ *
+ * @return $this
+ */
+ public function setBasedOn(?Circle $basedOn): self;
+
/**
* @return Circle
*/
@@ -48,4 +83,11 @@ public function getBasedOn(): Circle;
* @return bool
*/
public function hasBasedOn(): bool;
+
+ /**
+ * @param string $instance
+ *
+ * @return self
+ */
+ public function setInstance(string $instance): self;
}
diff --git a/lib/Model/FederatedUser.php b/lib/Model/FederatedUser.php
index 7d1b23c76..29bd92cad 100644
--- a/lib/Model/FederatedUser.php
+++ b/lib/Model/FederatedUser.php
@@ -184,11 +184,11 @@ public function hasBasedOn(): bool {
}
/**
- * @param Circle|null $basedOn
+ * @param ?Circle $basedOn
*
* @return $this
*/
- public function setBasedOn(Circle $basedOn): self {
+ public function setBasedOn(?Circle $basedOn): self {
$this->basedOn = $basedOn;
return $this;
diff --git a/lib/Model/Member.php b/lib/Model/Member.php
index 445956a8b..765491185 100644
--- a/lib/Model/Member.php
+++ b/lib/Model/Member.php
@@ -373,11 +373,11 @@ public function hasBasedOn(): bool {
}
/**
- * @param Circle $basedOn
+ * @param ?Circle $basedOn
*
* @return $this
*/
- public function setBasedOn(Circle $basedOn): self {
+ public function setBasedOn(?Circle $basedOn): self {
$this->basedOn = $basedOn;
return $this;
@@ -558,7 +558,7 @@ public function setNoteObj(string $key, JsonSerializable $obj): self {
/**
* @param string $displayName
*
- * @return Member
+ * @return $this
*/
public function setDisplayName(string $displayName): self {
if ($displayName !== '') {
diff --git a/lib/Tools/Db/ExtendedQueryBuilder.php b/lib/Tools/Db/ExtendedQueryBuilder.php
index 2c8557141..d88c9275e 100644
--- a/lib/Tools/Db/ExtendedQueryBuilder.php
+++ b/lib/Tools/Db/ExtendedQueryBuilder.php
@@ -195,7 +195,7 @@ public function limitToToken(string $token): void {
*/
public function limitToCreation(int $delay = 0): self {
$date = new DateTime('now');
- $date->sub(new DateInterval('PT' . $delay . 'M'));
+ $date->sub(new DateInterval('PT' . ((string)$delay) . 'M'));
$this->limitToDBFieldDateTime('creation', $date, true);
@@ -1063,7 +1063,7 @@ function (string $item) use ($alias) {
* @param array $fields
* @param string $alias
* @param string $prefix
- * @param array $default
+ * @param array $default
*
* @return $this
*/
diff --git a/lib/Tools/Traits/TArrayTools.php b/lib/Tools/Traits/TArrayTools.php
index 745e1b398..3a2b5e373 100644
--- a/lib/Tools/Traits/TArrayTools.php
+++ b/lib/Tools/Traits/TArrayTools.php
@@ -198,7 +198,7 @@ protected function getObj(string $k, array $arr, ?JsonSerializable $default = nu
/**
* @param string $k
- * @param array $arr
+ * @param array $arr
* @param array $default
*
* @return array
diff --git a/psalm.xml b/psalm.xml
index bcd446cbb..7250a2e0a 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -5,9 +5,78 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="tests/psalm-baseline.xml"
+ findUnusedCode="false"
+ ensureOverrideAttribute="false"
+ phpVersion="8.1"
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -21,35 +90,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml
index 0fdeef138..52ccea114 100644
--- a/tests/psalm-baseline.xml
+++ b/tests/psalm-baseline.xml
@@ -1,6 +1,9 @@
-
+
+
+
+
@@ -14,16 +17,10 @@
-
-
-
-
- federationNotifications]]>
-
-
-
-
-
+
+
+
+
@@ -35,43 +32,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -99,9 +64,6 @@
-
-
-
@@ -112,23 +74,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- connection]]>
-
-
+
+
+ getFileSource()]]>
+
@@ -136,6 +85,9 @@
+
+ settings)]]>
+
type]]>
@@ -160,6 +112,9 @@
+
+ getAddressBookId()]]>
+
get('addressBookId', $data)]]>
@@ -193,19 +148,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -221,23 +163,12 @@
-
-
-
-
-
-
-
-
- getFileCache()->toCache(), OC::$server->getMimeTypeLoader())]]>
- setAttributes($attributes)]]>
-
@@ -259,6 +190,10 @@
+
+ headers)]]>
+ payload)]]>
+
@@ -273,23 +208,32 @@
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -297,9 +241,9 @@
-
- FederatedUser
-
+
+ getUserType()]]>
+
@@ -309,33 +253,42 @@
+
+
+
+
+
getCircleId(), $knownIds)) {]]>
-
-
-
+
+ gInt('id')]]>
+
+
+
+
-
-
-
-
+
+
+
+
+
@@ -392,26 +345,108 @@
+
+
+ getData())]]>
+
+
+
+
+
+
+
+
+ getPort()]]>
+ getPort()]]>
+
+
+ getData())
+ )]]>
+ getParams())
+ )]]>
+
+
+
+
+
+
+
+ currentChild]]>
+
+
+
+
+
+
+
-
-
-
- logger]]>
+ logger)]]>
logger)]]>
+
+
+
+
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+ logger]]>
+
@@ -420,6 +455,18 @@
+
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+ clientService]]>
+
@@ -430,5 +477,12 @@
+
+
+
+
+
+
+
diff --git a/tests/stub.phpstub b/tests/stub.phpstub
deleted file mode 100644
index 5937f9ab6..000000000
--- a/tests/stub.phpstub
+++ /dev/null
@@ -1,1106 +0,0 @@
-cache = $cache;
- }
- public function getNumericStorageId() { }
- public function get() { }
- public function getIncomplete() {}
- public function getPathById($id) {}
- public function getAll() {}
- public function get($file) {}
- public function getFolderContents($folder) {}
- public function getFolderContentsById($fileId) {}
- public function put($file, array $data) {}
- public function insert($file, array $data) {}
- public function update($id, array $data) {}
- public function getId($file) {}
- public function getParentId($file) {}
- public function inCache($file) {}
- public function remove($file) {}
- public function move($source, $target) {}
- public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {}
- public function clear() {}
- public function getStatus($file) {}
- public function search($pattern) {}
- public function searchByMime($mimetype) {}
- public function searchQuery(ISearchQuery $query) {}
- public function correctFolderSize($path, $data = null, $isBackgroundScan = false) {}
- public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int {}
- public function normalize($path) {}
- public function getQueryFilterForStorage(): ISearchOperator {}
- public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry {}
- public static function cacheEntryFromData($data, IMimeTypeLoader $mimetypeLoader): ICacheEntry {}
- }
-}
-
-namespace OC\Files\Cache\Wrapper {
- use OC\Files\Cache\Cache;
- class CacheWrapper extends Cache {}
-}
-
-namespace OC\Files {
- use OCP\Files\Cache\ICacheEntry;
- use OCP\Files\Mount\IMountPoint;
- use OCP\IUser;
-
- class Filesystem {
- public static function addStorageWrapper(string $wrapperName, callable $wrapper, int $priority = 50) {
- }
- }
-
- class FileInfo implements \OCP\Files\FileInfo {
- /**
- * @param string|boolean $path
- * @param \OCP\Files\Storage\IStorage $storage
- * @param string $internalPath
- * @param array|ICacheEntry $data
- * @param \OCP\Files\Mount\IMountPoint $mount
- * @param \OCP\IUser|null $owner
- */
- public function __construct($path, $storage, $internalPath, $data, $mount, $owner = null) {}
- }
- class View {
- public function __construct(string $path) {}
- public function unlink($path) {}
- }
-}
-
-namespace OC\User {
- use OCP\UserInterface;
- use OCP\IUser;
- use Symfony\Component\EventDispatcher\EventDispatcherInterface;
- class User implements IUser {
- public function __construct(string $uid, ?UserInterface $backend, EventDispatcherInterface $dispatcher, $emitter = null, IConfig $config = null, $urlGenerator = null) {}
- }
-}
-
-namespace OCA\DAV\Upload {
-
- use Sabre\DAV\File;
-
- abstract class FutureFile extends File {}
-}
-
-namespace OCA\DAV\Connector\Sabre {
-
- class Node {
- public function getFileInfo(): \OCP\Files\FileInfo {}
- }
-}
-
-namespace OCA\Files\Event {
- class LoadAdditionalScriptsEvent extends \OCP\EventDispatcher\Event {}
-}
-
-namespace OC\BackgroundJob {
-
- use OCP\BackgroundJob\IJob;
- use OCP\BackgroundJob\IJobList;
- use OCP\ILogger;
-
- abstract class TimedJob implements IJob {
- public function execute(IJobList $jobList, ILogger $logger = null) {
- }
-
- abstract protected function run($argument);
-
- public function setId(int $id) {
- }
-
- public function setLastRun(int $lastRun) {
- }
-
- public function setArgument($argument) {
- }
-
- public function getId() {
- }
-
- public function getLastRun() {
- }
-
- public function getArgument() {
- }
- }
-}
-
-namespace OC\Files\Mount {
- use OC\Files\Filesystem;
- use OC\Files\Storage\Storage;
- use OC\Files\Storage\StorageFactory;
- use OCP\Files\Mount\IMountPoint;
-
- class MountPoint implements IMountPoint {
- /**
- * @var \OC\Files\Storage\Storage $storage
- */
- protected $storage = null;
- protected $class;
- protected $storageId;
- protected $rootId = null;
-
- /** @var int|null */
- protected $mountId;
-
- /**
- * @param string|\OCP\Files\Storage\IStorage $storage
- * @param string $mountpoint
- * @param array $arguments (optional) configuration for the storage backend
- * @param \OCP\Files\Storage\IStorageFactory $loader
- * @param array $mountOptions mount specific options
- * @param int|null $mountId
- * @throws \Exception
- */
- public function __construct($storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) {
- throw new \Exception('stub');
- }
-
- /**
- * get complete path to the mount point, relative to data/
- *
- * @return string
- */
- public function getMountPoint() {
- throw new \Exception('stub');
- }
-
- /**
- * Sets the mount point path, relative to data/
- *
- * @param string $mountPoint new mount point
- */
- public function setMountPoint($mountPoint) {
- throw new \Exception('stub');
- }
-
- /**
- * @return \OCP\Files\Storage\IStorage
- */
- public function getStorage() {
- throw new \Exception('stub');
- }
-
- /**
- * @return string
- */
- public function getStorageId() {
- throw new \Exception('stub');
- }
-
- /**
- * @return int
- */
- public function getNumericStorageId() {
- throw new \Exception('stub');
- }
-
- /**
- * @param string $path
- * @return string
- */
- public function getInternalPath($path) {
- throw new \Exception('stub');
- }
-
- /**
- * @param callable $wrapper
- */
- public function wrapStorage($wrapper) {
- throw new \Exception('stub');
- }
-
- /**
- * Get a mount option
- *
- * @param string $name Name of the mount option to get
- * @param mixed $default Default value for the mount option
- * @return mixed
- */
- public function getOption($name, $default) {
- throw new \Exception('stub');
- }
-
- /**
- * Get all options for the mount
- *
- * @return array
- */
- public function getOptions() {
- throw new \Exception('stub');
- }
-
- /**
- * @return int
- */
- public function getStorageRootId() {
- throw new \Exception('stub');
- }
-
- public function getMountId() {
- throw new \Exception('stub');
- }
-
- public function getMountType() {
- throw new \Exception('stub');
- }
-
- public function getMountProvider(): string {
- throw new \Exception('stub');
- }
- }
-}
-
-namespace OC\Files\Storage\Wrapper{
-
- use OCP\Files\Cache\ICache;
- use OCP\Files\Cache\ICacheEntry;
- use OCP\Files\Search\ISearchQuery;
- use OCP\Files\Storage\IStorage;
-
- class Wrapper implements IStorage {
- public function __construct(array $parameters) {
- }
-
- public function getWrapperStorage(): ?IStorage {}
-
- public function getId() {}
-
- public function mkdir($path) {}
-
- public function rmdir($path) {}
-
- public function opendir($path) {
- throw new \Exception('stub');
- }
-
- public function is_dir($path) {
- throw new \Exception('stub');
- }
-
- public function is_file($path) {
- throw new \Exception('stub');
- }
-
- public function stat($path) {
- throw new \Exception('stub');
- }
-
- public function filetype($path) {
- throw new \Exception('stub');
- }
-
- public function filesize($path) {
- throw new \Exception('stub');
- }
-
- public function isCreatable($path) {
- throw new \Exception('stub');
- }
-
- public function isReadable($path) {
- throw new \Exception('stub');
- }
-
- public function isUpdatable($path) {
- throw new \Exception('stub');
- }
-
- public function isDeletable($path) {
- throw new \Exception('stub');
- }
-
- public function isSharable($path) {
- throw new \Exception('stub');
- }
-
- public function getPermissions($path) {
- throw new \Exception('stub');
- }
-
- public function file_exists($path) {
- throw new \Exception('stub');
- }
-
- public function filemtime($path) {
- throw new \Exception('stub');
- }
-
- public function file_get_contents($path) {
- throw new \Exception('stub');
- }
-
- public function file_put_contents($path, $data) {
- throw new \Exception('stub');
- }
-
- public function unlink($path) {
- throw new \Exception('stub');
- }
-
- public function rename($path1, $path2) {
- throw new \Exception('stub');
- }
-
- public function copy($path1, $path2) {
- throw new \Exception('stub');
- }
-
- public function fopen($path, $mode) {
- throw new \Exception('stub');
- }
-
- public function getMimeType($path) {
- throw new \Exception('stub');
- }
-
- public function hash($type, $path, $raw = false) {
- throw new \Exception('stub');
- }
-
- public function free_space($path) {
- throw new \Exception('stub');
- }
-
- public function touch($path, $mtime = null) {
- throw new \Exception('stub');
- }
-
- public function getLocalFile($path) {
- throw new \Exception('stub');
- }
-
- public function hasUpdated($path, $time) {
- throw new \Exception('stub');
- }
-
- public function getETag($path) {
- throw new \Exception('stub');
- }
-
- public function isLocal() {
- throw new \Exception('stub');
- }
-
- public function instanceOfStorage($class) {
- throw new \Exception('stub');
- }
-
- public function getDirectDownload($path) {
- throw new \Exception('stub');
- }
-
- public function verifyPath($path, $fileName) {
- throw new \Exception('stub');
- }
-
- public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
- throw new \Exception('stub');
- }
-
- public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
- throw new \Exception('stub');
- }
-
- public function test() {
- throw new \Exception('stub');
- }
-
- public function getAvailability() {
- throw new \Exception('stub');
- }
-
- public function setAvailability($isAvailable) {
- throw new \Exception('stub');
- }
-
- public function getOwner($path) {
- throw new \Exception('stub');
- }
-
- public function getCache() {
- throw new \Exception('stub');
- }
-
- public function getPropagator() {
- throw new \Exception('stub');
- }
-
- public function getScanner() {
- throw new \Exception('stub');
- }
-
- public function getUpdater() {
- throw new \Exception('stub');
- }
-
- public function getWatcher() {
- throw new \Exception('stub');
- }
- }
-
- class Jail extends Wrapper {
- public function getUnjailedPath(string $path): string {}
- }
-
- class Quota extends Wrapper {
- public function getQuota() {}
- }
-
- class PermissionsMask extends Wrapper {
- public function getQuota() {}
- }
-}
-
-namespace OC\AppFramework\Middleware\Security\Exceptions {
- class NotLoggedInException extends \Exception {}
-}
-
-namespace OC\Share20 {
- use OCP\Files\Node;
-
- class Share implements \OCP\Share\IShare {
- public function __construct(\OCP\Files\IRootFolder $rootFolder, \OCP\IUserManager $userManager) {}
- public function setId($id) {}
- public function getId() {}
- public function getFullId() {}
- public function setProviderId($id) {}
- public function setNode(Node $node) {}
- public function getNode() {}
- public function setNodeId($fileId) {}
- public function getNodeId() {}
- public function setNodeType($type) {}
- public function getNodeType() {}
- public function setShareType($shareType) {}
- public function getShareType() {}
- public function setSharedWith($sharedWith) {}
- public function getSharedWith() {}
- public function setSharedWithDisplayName($displayName) {}
- public function getSharedWithDisplayName() {}
- public function setSharedWithAvatar($src) {}
- public function getSharedWithAvatar() {}
- public function setPermissions($permissions) {}
- public function getPermissions() {}
- public function newAttributes(): \OCP\Share\IAttributes {}
- public function setAttributes(?\OCP\Share\IAttributes $attributes) {}
- public function getAttributes(): ?\OCP\Share\IAttributes {}
- public function setStatus(int $status): \OCP\Share\IShare {}
- public function getStatus(): int {}
- public function setNote($note) {}
- public function getNote() {}
- public function setExpirationDate($expireDate) {}
- public function getExpirationDate() {}
- public function isExpired() {}
- public function setLabel($label) {}
- public function getLabel() {}
- public function setSharedBy($sharedBy) {}
- public function getSharedBy() {}
- public function setShareOwner($shareOwner) {}
- public function getShareOwner() {}
- public function setPassword($password) {}
- public function getPassword() {}
- public function setPasswordExpirationTime(?\DateTimeInterface $passwordExpirationTime = null): \OCP\Share\IShare {}
- public function getPasswordExpirationTime(): ?\DateTimeInterface {}
- public function setSendPasswordByTalk(bool $sendPasswordByTalk) {}
- public function getSendPasswordByTalk(): bool {}
- public function setToken($token) {}
- public function getToken() {}
- public function setTarget($target) {}
- public function getTarget() {}
- public function setShareTime(\DateTime $shareTime) {}
- public function getShareTime() {}
- public function setMailSend($mailSend) {}
- public function getMailSend() {}
- public function setNodeCacheEntry(OCP\Files\Cache\ICacheEntry $entry) {}
- public function getNodeCacheEntry() {}
- public function setHideDownload(bool $hide): \OCP\Share\IShare;
- public function getHideDownload(): bool;
- }
-}
-
-namespace OC\AppFramework\Bootstrap {
- use OCP\Teams\ITeamResourceProvider;
-
- class Coordinator {
- public function getRegistrationContext(): ?RegistrationContext {}
- }
-
- class RegistrationContext {
- /**
- * @return ServiceRegistration[]
- */
- public function getTeamResourceProviders(): array {}
- }
-
- /**
- * @psalm-immutable
- * @template T
- */
- class ServiceRegistration extends ARegistration {
- /**
- * @psalm-return class-string
- */
- public function getService(): string {}
- }
-
- /**
- * @psalm-immutable
- */
- abstract class ARegistration {}
-}
diff --git a/tests/stubs/doctrine_dbal_connection.php b/tests/stubs/doctrine_dbal_connection.php
new file mode 100644
index 000000000..d68b30286
--- /dev/null
+++ b/tests/stubs/doctrine_dbal_connection.php
@@ -0,0 +1,970 @@
+ $params The connection parameters.
+ * @param Driver $driver The driver to use.
+ * @param Configuration|null $config The configuration, optional.
+ * @param EventManager|null $eventManager The event manager, optional.
+ * @psalm-param Params $params
+ *
+ * @throws Exception
+ */
+ public function __construct(#[SensitiveParameter]
+ array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null)
+ {
+ }
+
+ /**
+ * Gets the parameters used during instantiation.
+ *
+ * @internal
+ *
+ * @return array
+ * @psalm-return Params
+ */
+ public function getParams()
+ {
+ }
+
+ /**
+ * Gets the name of the currently selected database.
+ *
+ * @return string|null The name of the database or NULL if a database is not selected.
+ * The platforms which don't support the concept of a database (e.g. embedded databases)
+ * must always return a string as an indicator of an implicitly selected database.
+ *
+ * @throws Exception
+ */
+ public function getDatabase()
+ {
+ }
+
+ /**
+ * Gets the DBAL driver instance.
+ *
+ * @return Driver
+ */
+ public function getDriver()
+ {
+ }
+
+ /**
+ * Gets the Configuration used by the Connection.
+ *
+ * @return Configuration
+ */
+ public function getConfiguration()
+ {
+ }
+
+ /**
+ * Gets the EventManager used by the Connection.
+ *
+ * @deprecated
+ *
+ * @return EventManager
+ */
+ public function getEventManager()
+ {
+ }
+
+ /**
+ * Gets the DatabasePlatform for the connection.
+ *
+ * @return AbstractPlatform
+ *
+ * @throws Exception
+ */
+ public function getDatabasePlatform()
+ {
+ }
+
+ /**
+ * Creates an expression builder for the connection.
+ */
+ public function createExpressionBuilder(): ExpressionBuilder
+ {
+ }
+
+ /**
+ * Gets the ExpressionBuilder for the connection.
+ *
+ * @deprecated Use {@see createExpressionBuilder()} instead.
+ *
+ * @return ExpressionBuilder
+ */
+ public function getExpressionBuilder()
+ {
+ }
+
+ /**
+ * Establishes the connection with the database.
+ *
+ * @internal This method will be made protected in DBAL 4.0.
+ *
+ * @return bool TRUE if the connection was successfully established, FALSE if
+ * the connection is already open.
+ *
+ * @throws Exception
+ *
+ * @psalm-assert !null $this->_conn
+ */
+ public function connect()
+ {
+ }
+
+ /**
+ * Returns the current auto-commit mode for this connection.
+ *
+ * @see setAutoCommit
+ *
+ * @return bool True if auto-commit mode is currently enabled for this connection, false otherwise.
+ */
+ public function isAutoCommit()
+ {
+ }
+
+ /**
+ * Sets auto-commit mode for this connection.
+ *
+ * If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual
+ * transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either
+ * the method commit or the method rollback. By default, new connections are in auto-commit mode.
+ *
+ * NOTE: If this method is called during a transaction and the auto-commit mode is changed, the transaction is
+ * committed. If this method is called and the auto-commit mode is not changed, the call is a no-op.
+ *
+ * @see isAutoCommit
+ *
+ * @param bool $autoCommit True to enable auto-commit mode; false to disable it.
+ *
+ * @return void
+ */
+ public function setAutoCommit($autoCommit)
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the first row of the result
+ * as an associative array.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return array|false False is returned if no rows are found.
+ *
+ * @throws Exception
+ */
+ public function fetchAssociative(string $query, array $params = [], array $types = [])
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the first row of the result
+ * as a numerically indexed array.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return list|false False is returned if no rows are found.
+ *
+ * @throws Exception
+ */
+ public function fetchNumeric(string $query, array $params = [], array $types = [])
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the value of a single column
+ * of the first row of the result.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return mixed|false False is returned if no rows are found.
+ *
+ * @throws Exception
+ */
+ public function fetchOne(string $query, array $params = [], array $types = [])
+ {
+ }
+
+ /**
+ * Whether an actual connection to the database is established.
+ *
+ * @return bool
+ */
+ public function isConnected()
+ {
+ }
+
+ /**
+ * Checks whether a transaction is currently active.
+ *
+ * @return bool TRUE if a transaction is currently active, FALSE otherwise.
+ */
+ public function isTransactionActive()
+ {
+ }
+
+ /**
+ * Executes an SQL DELETE statement on a table.
+ *
+ * Table expression and columns are not escaped and are not safe for user-input.
+ *
+ * @param string $table Table name
+ * @param array $criteria Deletion criteria
+ * @param array|array $types Parameter types
+ *
+ * @return int|string The number of affected rows.
+ *
+ * @throws Exception
+ */
+ public function delete($table, array $criteria, array $types = [])
+ {
+ }
+
+ /**
+ * Closes the connection.
+ *
+ * @return void
+ */
+ public function close()
+ {
+ }
+
+ /**
+ * Sets the transaction isolation level.
+ *
+ * @param TransactionIsolationLevel::* $level The level to set.
+ *
+ * @return int|string
+ *
+ * @throws Exception
+ */
+ public function setTransactionIsolation($level)
+ {
+ }
+
+ /**
+ * Gets the currently active transaction isolation level.
+ *
+ * @return TransactionIsolationLevel::* The current transaction isolation level.
+ *
+ * @throws Exception
+ */
+ public function getTransactionIsolation()
+ {
+ }
+
+ /**
+ * Executes an SQL UPDATE statement on a table.
+ *
+ * Table expression and columns are not escaped and are not safe for user-input.
+ *
+ * @param string $table Table name
+ * @param array $data Column-value pairs
+ * @param array $criteria Update criteria
+ * @param array|array $types Parameter types
+ *
+ * @return int|string The number of affected rows.
+ *
+ * @throws Exception
+ */
+ public function update($table, array $data, array $criteria, array $types = [])
+ {
+ }
+
+ /**
+ * Inserts a table row with specified data.
+ *
+ * Table expression and columns are not escaped and are not safe for user-input.
+ *
+ * @param string $table Table name
+ * @param array $data Column-value pairs
+ * @param array|array $types Parameter types
+ *
+ * @return int|string The number of affected rows.
+ *
+ * @throws Exception
+ */
+ public function insert($table, array $data, array $types = [])
+ {
+ }
+
+ /**
+ * Quotes a string so it can be safely used as a table or column name, even if
+ * it is a reserved name.
+ *
+ * Delimiting style depends on the underlying database platform that is being used.
+ *
+ * NOTE: Just because you CAN use quoted identifiers does not mean
+ * you SHOULD use them. In general, they end up causing way more
+ * problems than they solve.
+ *
+ * @param string $str The name to be quoted.
+ *
+ * @return string The quoted name.
+ */
+ public function quoteIdentifier($str)
+ {
+ }
+
+ /**
+ * The usage of this method is discouraged. Use prepared statements
+ * or {@see AbstractPlatform::quoteStringLiteral()} instead.
+ *
+ * @param mixed $value
+ * @param int|string|Type|null $type
+ *
+ * @return mixed
+ */
+ public function quote($value, $type = ParameterType::STRING)
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an array of numeric arrays.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return list>
+ *
+ * @throws Exception
+ */
+ public function fetchAllNumeric(string $query, array $params = [], array $types = []): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an array of associative arrays.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return list>
+ *
+ * @throws Exception
+ */
+ public function fetchAllAssociative(string $query, array $params = [], array $types = []): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an associative array with the keys
+ * mapped to the first column and the values mapped to the second column.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return array
+ *
+ * @throws Exception
+ */
+ public function fetchAllKeyValue(string $query, array $params = [], array $types = []): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an associative array with the keys mapped
+ * to the first column and the values being an associative array representing the rest of the columns
+ * and their values.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return array>
+ *
+ * @throws Exception
+ */
+ public function fetchAllAssociativeIndexed(string $query, array $params = [], array $types = []): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an array of the first column values.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return list
+ *
+ * @throws Exception
+ */
+ public function fetchFirstColumn(string $query, array $params = [], array $types = []): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an iterator over rows represented as numeric arrays.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return Traversable>
+ *
+ * @throws Exception
+ */
+ public function iterateNumeric(string $query, array $params = [], array $types = []): Traversable
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an iterator over rows represented
+ * as associative arrays.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return Traversable>
+ *
+ * @throws Exception
+ */
+ public function iterateAssociative(string $query, array $params = [], array $types = []): Traversable
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an iterator with the keys
+ * mapped to the first column and the values mapped to the second column.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return Traversable
+ *
+ * @throws Exception
+ */
+ public function iterateKeyValue(string $query, array $params = [], array $types = []): Traversable
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an iterator with the keys mapped
+ * to the first column and the values being an associative array representing the rest of the columns
+ * and their values.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return Traversable>
+ *
+ * @throws Exception
+ */
+ public function iterateAssociativeIndexed(string $query, array $params = [], array $types = []): Traversable
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an iterator over the first column values.
+ *
+ * @param string $query SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @return Traversable
+ *
+ * @throws Exception
+ */
+ public function iterateColumn(string $query, array $params = [], array $types = []): Traversable
+ {
+ }
+
+ /**
+ * Prepares an SQL statement.
+ *
+ * @param string $sql The SQL statement to prepare.
+ *
+ * @throws Exception
+ */
+ public function prepare(string $sql): Statement
+ {
+ }
+
+ /**
+ * Executes an, optionally parameterized, SQL query.
+ *
+ * If the query is parametrized, a prepared statement is used.
+ * If an SQLLogger is configured, the execution is logged.
+ *
+ * @param string $sql SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @throws Exception
+ */
+ public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result
+ {
+ }
+
+ /**
+ * Executes a caching query.
+ *
+ * @param string $sql SQL query
+ * @param list|array $params Query parameters
+ * @param array|array $types Parameter types
+ *
+ * @throws CacheException
+ * @throws Exception
+ */
+ public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result
+ {
+ }
+
+ /**
+ * Executes an SQL statement with the given parameters and returns the number of affected rows.
+ *
+ * Could be used for:
+ * - DML statements: INSERT, UPDATE, DELETE, etc.
+ * - DDL statements: CREATE, DROP, ALTER, etc.
+ * - DCL statements: GRANT, REVOKE, etc.
+ * - Session control statements: ALTER SESSION, SET, DECLARE, etc.
+ * - Other statements that don't yield a row set.
+ *
+ * This method supports PDO binding types as well as DBAL mapping types.
+ *
+ * @param string $sql SQL statement
+ * @param list|array $params Statement parameters
+ * @param array|array $types Parameter types
+ *
+ * @return int|string The number of affected rows.
+ *
+ * @throws Exception
+ */
+ public function executeStatement($sql, array $params = [], array $types = [])
+ {
+ }
+
+ /**
+ * Returns the current transaction nesting level.
+ *
+ * @return int The nesting level. A value of 0 means there's no active transaction.
+ */
+ public function getTransactionNestingLevel()
+ {
+ }
+
+ /**
+ * Returns the ID of the last inserted row, or the last value from a sequence object,
+ * depending on the underlying driver.
+ *
+ * Note: This method may not return a meaningful or consistent result across different drivers,
+ * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY
+ * columns or sequences.
+ *
+ * @param string|null $name Name of the sequence object from which the ID should be returned.
+ *
+ * @return string|int|false A string representation of the last inserted ID.
+ *
+ * @throws Exception
+ */
+ public function lastInsertId($name = null)
+ {
+ }
+
+ /**
+ * Executes a function in a transaction.
+ *
+ * The function gets passed this Connection instance as an (optional) parameter.
+ *
+ * If an exception occurs during execution of the function or transaction commit,
+ * the transaction is rolled back and the exception re-thrown.
+ *
+ * @param Closure(self):T $func The function to execute transactionally.
+ *
+ * @return T The value returned by $func
+ *
+ * @throws Throwable
+ *
+ * @template T
+ */
+ public function transactional(Closure $func)
+ {
+ }
+
+ /**
+ * Sets if nested transactions should use savepoints.
+ *
+ * @param bool $nestTransactionsWithSavepoints
+ *
+ * @return void
+ *
+ * @throws Exception
+ */
+ public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints)
+ {
+ }
+
+ /**
+ * Gets if nested transactions should use savepoints.
+ *
+ * @return bool
+ */
+ public function getNestTransactionsWithSavepoints()
+ {
+ }
+
+ /**
+ * Returns the savepoint name to use for nested transactions.
+ *
+ * @return string
+ */
+ protected function _getNestedTransactionSavePointName()
+ {
+ }
+
+ /**
+ * @return bool
+ *
+ * @throws Exception
+ */
+ public function beginTransaction()
+ {
+ }
+
+ /**
+ * @return bool
+ *
+ * @throws Exception
+ */
+ public function commit()
+ {
+ }
+
+ /**
+ * Cancels any database changes done during the current transaction.
+ *
+ * @return bool
+ *
+ * @throws Exception
+ */
+ public function rollBack()
+ {
+ }
+
+ /**
+ * Creates a new savepoint.
+ *
+ * @param string $savepoint The name of the savepoint to create.
+ *
+ * @return void
+ *
+ * @throws Exception
+ */
+ public function createSavepoint($savepoint)
+ {
+ }
+
+ /**
+ * Releases the given savepoint.
+ *
+ * @param string $savepoint The name of the savepoint to release.
+ *
+ * @return void
+ *
+ * @throws Exception
+ */
+ public function releaseSavepoint($savepoint)
+ {
+ }
+
+ /**
+ * Rolls back to the given savepoint.
+ *
+ * @param string $savepoint The name of the savepoint to rollback to.
+ *
+ * @return void
+ *
+ * @throws Exception
+ */
+ public function rollbackSavepoint($savepoint)
+ {
+ }
+
+ /**
+ * Gets the wrapped driver connection.
+ *
+ * @deprecated Use {@link getNativeConnection()} to access the native connection.
+ *
+ * @return DriverConnection
+ *
+ * @throws Exception
+ */
+ public function getWrappedConnection()
+ {
+ }
+
+ /** @return resource|object */
+ public function getNativeConnection()
+ {
+ }
+
+ /**
+ * Creates a SchemaManager that can be used to inspect or change the
+ * database schema through the connection.
+ *
+ * @throws Exception
+ */
+ public function createSchemaManager(): AbstractSchemaManager
+ {
+ }
+
+ /**
+ * Gets the SchemaManager that can be used to inspect or change the
+ * database schema through the connection.
+ *
+ * @deprecated Use {@see createSchemaManager()} instead.
+ *
+ * @return AbstractSchemaManager
+ *
+ * @throws Exception
+ */
+ public function getSchemaManager()
+ {
+ }
+
+ /**
+ * Marks the current transaction so that the only possible
+ * outcome for the transaction to be rolled back.
+ *
+ * @return void
+ *
+ * @throws ConnectionException If no transaction is active.
+ */
+ public function setRollbackOnly()
+ {
+ }
+
+ /**
+ * Checks whether the current transaction is marked for rollback only.
+ *
+ * @return bool
+ *
+ * @throws ConnectionException If no transaction is active.
+ */
+ public function isRollbackOnly()
+ {
+ }
+
+ /**
+ * Converts a given value to its database representation according to the conversion
+ * rules of a specific DBAL mapping type.
+ *
+ * @param mixed $value The value to convert.
+ * @param string $type The name of the DBAL mapping type.
+ *
+ * @return mixed The converted value.
+ *
+ * @throws Exception
+ */
+ public function convertToDatabaseValue($value, $type)
+ {
+ }
+
+ /**
+ * Converts a given value to its PHP representation according to the conversion
+ * rules of a specific DBAL mapping type.
+ *
+ * @param mixed $value The value to convert.
+ * @param string $type The name of the DBAL mapping type.
+ *
+ * @return mixed The converted type.
+ *
+ * @throws Exception
+ */
+ public function convertToPHPValue($value, $type)
+ {
+ }
+
+ /**
+ * Creates a new instance of a SQL query builder.
+ *
+ * @return QueryBuilder
+ */
+ public function createQueryBuilder()
+ {
+ }
+
+ /**
+ * @internal
+ *
+ * @param list|array $params
+ * @param array|array $types
+ */
+ final public function convertExceptionDuringQuery(Driver\Exception $e, string $sql, array $params = [], array $types = []): DriverException
+ {
+ }
+
+ /** @internal */
+ final public function convertException(Driver\Exception $e): DriverException
+ {
+ }
+
+ /**
+ * BC layer for a wide-spread use-case of old DBAL APIs
+ *
+ * @deprecated Use {@see executeStatement()} instead
+ *
+ * @param array $params The query parameters
+ * @param array $types The parameter types
+ */
+ public function executeUpdate(string $sql, array $params = [], array $types = []): int
+ {
+ }
+
+ /**
+ * BC layer for a wide-spread use-case of old DBAL APIs
+ *
+ * @deprecated Use {@see executeQuery()} instead
+ */
+ public function query(string $sql): Result
+ {
+ }
+
+ /**
+ * BC layer for a wide-spread use-case of old DBAL APIs
+ *
+ * @deprecated please use {@see executeStatement()} instead
+ */
+ public function exec(string $sql): int
+ {
+ }
+}
diff --git a/tests/stubs/doctrine_dbal_connections_primaryreadreplicaconnection.php b/tests/stubs/doctrine_dbal_connections_primaryreadreplicaconnection.php
new file mode 100644
index 000000000..8cbb24eda
--- /dev/null
+++ b/tests/stubs/doctrine_dbal_connections_primaryreadreplicaconnection.php
@@ -0,0 +1,233 @@
+executeQuery("DELETE FROM table");
+ *
+ * Be aware that Connection#executeQuery is a method specifically for READ
+ * operations only.
+ *
+ * Use Connection#executeStatement for any SQL statement that changes/updates
+ * state in the database (UPDATE, INSERT, DELETE or DDL statements).
+ *
+ * This connection is limited to replica operations using the
+ * Connection#executeQuery operation only, because it wouldn't be compatible
+ * with the ORM or SchemaManager code otherwise. Both use all the other
+ * operations in a context where writes could happen to a replica, which makes
+ * this restricted approach necessary.
+ *
+ * You can manually connect to the primary at any time by calling:
+ *
+ * $conn->ensureConnectedToPrimary();
+ *
+ * Instantiation through the DriverManager looks like:
+ *
+ * @psalm-import-type Params from DriverManager
+ * @example
+ *
+ * $conn = DriverManager::getConnection(array(
+ * 'wrapperClass' => 'Doctrine\DBAL\Connections\PrimaryReadReplicaConnection',
+ * 'driver' => 'pdo_mysql',
+ * 'primary' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''),
+ * 'replica' => array(
+ * array('user' => 'replica1', 'password' => '', 'host' => '', 'dbname' => ''),
+ * array('user' => 'replica2', 'password' => '', 'host' => '', 'dbname' => ''),
+ * )
+ * ));
+ *
+ * You can also pass 'driverOptions' and any other documented option to each of this drivers
+ * to pass additional information.
+ */
+class PrimaryReadReplicaConnection extends Connection
+{
+ /**
+ * Primary and Replica connection (one of the randomly picked replicas).
+ *
+ * @var DriverConnection[]|null[]
+ */
+ protected $connections = ['primary' => null, 'replica' => null];
+
+ /**
+ * You can keep the replica connection and then switch back to it
+ * during the request if you know what you are doing.
+ *
+ * @var bool
+ */
+ protected $keepReplica = false;
+
+ /**
+ * Creates Primary Replica Connection.
+ *
+ * @internal The connection can be only instantiated by the driver manager.
+ *
+ * @param array $params
+ * @psalm-param Params $params
+ *
+ * @throws Exception
+ * @throws InvalidArgumentException
+ */
+ public function __construct(array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null)
+ {
+ }
+
+ /**
+ * Checks if the connection is currently towards the primary or not.
+ */
+ public function isConnectedToPrimary(): bool
+ {
+ }
+
+ /**
+ * @param string|null $connectionName
+ *
+ * @return bool
+ */
+ public function connect($connectionName = null)
+ {
+ }
+
+ protected function performConnect(?string $connectionName = null): bool
+ {
+ }
+
+ /**
+ * Connects to the primary node of the database cluster.
+ *
+ * All following statements after this will be executed against the primary node.
+ */
+ public function ensureConnectedToPrimary(): bool
+ {
+ }
+
+ /**
+ * Connects to a replica node of the database cluster.
+ *
+ * All following statements after this will be executed against the replica node,
+ * unless the keepReplica option is set to false and a primary connection
+ * was already opened.
+ */
+ public function ensureConnectedToReplica(): bool
+ {
+ }
+
+ /**
+ * Connects to a specific connection.
+ *
+ * @param string $connectionName
+ *
+ * @return DriverConnection
+ *
+ * @throws Exception
+ */
+ protected function connectTo($connectionName)
+ {
+ }
+
+ /**
+ * @param string $connectionName
+ * @param mixed[] $params
+ *
+ * @return mixed
+ */
+ protected function chooseConnectionConfiguration($connectionName, #[SensitiveParameter]
+ $params)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function executeStatement($sql, array $params = [], array $types = [])
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function beginTransaction()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function commit()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function rollBack()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function close()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function createSavepoint($savepoint)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function releaseSavepoint($savepoint)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function rollbackSavepoint($savepoint)
+ {
+ }
+
+ public function prepare(string $sql): Statement
+ {
+ }
+}
diff --git a/tests/stubs/doctrine_dbal_driver_exception.php b/tests/stubs/doctrine_dbal_driver_exception.php
new file mode 100644
index 000000000..afcb3f76b
--- /dev/null
+++ b/tests/stubs/doctrine_dbal_driver_exception.php
@@ -0,0 +1,22 @@
+ [],
+ 'distinct' => false,
+ 'from' => [],
+ 'join' => [],
+ 'set' => [],
+ 'where' => null,
+ 'groupBy' => [],
+ 'having' => null,
+ 'orderBy' => [],
+ 'values' => [],
+ 'for_update' => null,
+ ];
+
+ /**
+ * Initializes a new QueryBuilder.
+ *
+ * @param Connection $connection The DBAL Connection.
+ */
+ public function __construct(Connection $connection)
+ {
+ }
+
+ /**
+ * Gets an ExpressionBuilder used for object-oriented construction of query expressions.
+ * This producer method is intended for convenient inline usage. Example:
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where($qb->expr()->eq('u.id', 1));
+ *
+ *
+ * For more complex expression construction, consider storing the expression
+ * builder object in a local variable.
+ *
+ * @return ExpressionBuilder
+ */
+ public function expr()
+ {
+ }
+
+ /**
+ * Gets the type of the currently built query.
+ *
+ * @deprecated If necessary, track the type of the query being built outside of the builder.
+ *
+ * @return int
+ */
+ public function getType()
+ {
+ }
+
+ /**
+ * Gets the associated DBAL Connection for this query builder.
+ *
+ * @deprecated Use the connection used to instantiate the builder instead.
+ *
+ * @return Connection
+ */
+ public function getConnection()
+ {
+ }
+
+ /**
+ * Gets the state of this query builder instance.
+ *
+ * @deprecated The builder state is an internal concern.
+ *
+ * @return int Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN.
+ * @psalm-return self::STATE_*
+ */
+ public function getState()
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the first row of the result
+ * as an associative array.
+ *
+ * @return array|false False is returned if no rows are found.
+ *
+ * @throws Exception
+ */
+ public function fetchAssociative()
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the first row of the result
+ * as a numerically indexed array.
+ *
+ * @return array|false False is returned if no rows are found.
+ *
+ * @throws Exception
+ */
+ public function fetchNumeric()
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the value of a single column
+ * of the first row of the result.
+ *
+ * @return mixed|false False is returned if no rows are found.
+ *
+ * @throws Exception
+ */
+ public function fetchOne()
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an array of numeric arrays.
+ *
+ * @return array>
+ *
+ * @throws Exception
+ */
+ public function fetchAllNumeric(): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an array of associative arrays.
+ *
+ * @return array>
+ *
+ * @throws Exception
+ */
+ public function fetchAllAssociative(): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an associative array with the keys
+ * mapped to the first column and the values mapped to the second column.
+ *
+ * @return array
+ *
+ * @throws Exception
+ */
+ public function fetchAllKeyValue(): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an associative array with the keys mapped
+ * to the first column and the values being an associative array representing the rest of the columns
+ * and their values.
+ *
+ * @return array>
+ *
+ * @throws Exception
+ */
+ public function fetchAllAssociativeIndexed(): array
+ {
+ }
+
+ /**
+ * Prepares and executes an SQL query and returns the result as an array of the first column values.
+ *
+ * @return array
+ *
+ * @throws Exception
+ */
+ public function fetchFirstColumn(): array
+ {
+ }
+
+ /**
+ * Executes an SQL query (SELECT) and returns a Result.
+ *
+ * @throws Exception
+ */
+ public function executeQuery(): Result
+ {
+ }
+
+ /**
+ * Executes an SQL statement and returns the number of affected rows.
+ *
+ * Should be used for INSERT, UPDATE and DELETE
+ *
+ * @return int The number of affected rows.
+ *
+ * @throws Exception
+ */
+ public function executeStatement(): int
+ {
+ }
+
+ /**
+ * Executes this query using the bound parameters and their types.
+ *
+ * @deprecated Use {@see executeQuery()} or {@see executeStatement()} instead.
+ *
+ * @return Result|int|string
+ *
+ * @throws Exception
+ */
+ public function execute()
+ {
+ }
+
+ /**
+ * Gets the complete SQL string formed by the current specifications of this QueryBuilder.
+ *
+ *
+ * $qb = $em->createQueryBuilder()
+ * ->select('u')
+ * ->from('User', 'u')
+ * echo $qb->getSQL(); // SELECT u FROM User u
+ *
+ *
+ * @return string The SQL query string.
+ */
+ public function getSQL()
+ {
+ }
+
+ /**
+ * Sets a query parameter for the query being constructed.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where('u.id = :user_id')
+ * ->setParameter('user_id', 1);
+ *
+ *
+ * @param int|string $key Parameter position or name
+ * @param mixed $value Parameter value
+ * @param int|string|Type|null $type Parameter type
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setParameter($key, $value, $type = ParameterType::STRING)
+ {
+ }
+
+ /**
+ * Sets a collection of query parameters for the query being constructed.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where('u.id = :user_id1 OR u.id = :user_id2')
+ * ->setParameters(array(
+ * 'user_id1' => 1,
+ * 'user_id2' => 2
+ * ));
+ *
+ *
+ * @param list|array $params Parameters to set
+ * @param array|array $types Parameter types
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setParameters(array $params, array $types = [])
+ {
+ }
+
+ /**
+ * Gets all defined query parameters for the query being constructed indexed by parameter index or name.
+ *
+ * @return list|array The currently defined query parameters
+ */
+ public function getParameters()
+ {
+ }
+
+ /**
+ * Gets a (previously set) query parameter of the query being constructed.
+ *
+ * @param mixed $key The key (index or name) of the bound parameter.
+ *
+ * @return mixed The value of the bound parameter.
+ */
+ public function getParameter($key)
+ {
+ }
+
+ /**
+ * Gets all defined query parameter types for the query being constructed indexed by parameter index or name.
+ *
+ * @return array|array The currently defined
+ * query parameter types
+ */
+ public function getParameterTypes()
+ {
+ }
+
+ /**
+ * Gets a (previously set) query parameter type of the query being constructed.
+ *
+ * @param int|string $key The key of the bound parameter type
+ *
+ * @return int|string|Type The value of the bound parameter type
+ */
+ public function getParameterType($key)
+ {
+ }
+
+ /**
+ * Sets the position of the first result to retrieve (the "offset").
+ *
+ * @param int $firstResult The first result to return.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setFirstResult($firstResult)
+ {
+ }
+
+ /**
+ * Gets the position of the first result the query object was set to retrieve (the "offset").
+ *
+ * @return int The position of the first result.
+ */
+ public function getFirstResult()
+ {
+ }
+
+ /**
+ * Sets the maximum number of results to retrieve (the "limit").
+ *
+ * @param int|null $maxResults The maximum number of results to retrieve or NULL to retrieve all results.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setMaxResults($maxResults)
+ {
+ }
+
+ /**
+ * Gets the maximum number of results the query object was set to retrieve (the "limit").
+ * Returns NULL if all results will be returned.
+ *
+ * @return int|null The maximum number of results.
+ */
+ public function getMaxResults()
+ {
+ }
+
+ /**
+ * Locks the queried rows for a subsequent update.
+ *
+ * @return $this
+ */
+ public function forUpdate(int $conflictResolutionMode = ConflictResolutionMode::ORDINARY): self
+ {
+ }
+
+ /**
+ * Either appends to or replaces a single, generic query part.
+ *
+ * The available parts are: 'select', 'from', 'set', 'where',
+ * 'groupBy', 'having' and 'orderBy'.
+ *
+ * @param string $sqlPartName
+ * @param mixed $sqlPart
+ * @param bool $append
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function add($sqlPartName, $sqlPart, $append = false)
+ {
+ }
+
+ /**
+ * Specifies an item that is to be returned in the query result.
+ * Replaces any previously specified selections, if any.
+ *
+ * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.id', 'p.id')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id');
+ *
+ *
+ * @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED.
+ * Pass each value as an individual argument.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function select($select = null)
+ {
+ }
+
+ /**
+ * Adds or removes DISTINCT to/from the query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.id')
+ * ->distinct()
+ * ->from('users', 'u')
+ *
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function distinct(): self
+ {
+ }
+
+ /**
+ * Adds an item that is to be returned in the query result.
+ *
+ * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.id')
+ * ->addSelect('p.id')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id');
+ *
+ *
+ * @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED.
+ * Pass each value as an individual argument.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function addSelect($select = null)
+ {
+ }
+
+ /**
+ * Turns the query being built into a bulk delete query that ranges over
+ * a certain table.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->delete('users', 'u')
+ * ->where('u.id = :user_id')
+ * ->setParameter(':user_id', 1);
+ *
+ *
+ * @param string $delete The table whose rows are subject to the deletion.
+ * @param string $alias The table alias used in the constructed query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function delete($delete = null, $alias = null)
+ {
+ }
+
+ /**
+ * Turns the query being built into a bulk update query that ranges over
+ * a certain table
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->update('counters', 'c')
+ * ->set('c.value', 'c.value + 1')
+ * ->where('c.id = ?');
+ *
+ *
+ * @param string $update The table whose rows are subject to the update.
+ * @param string $alias The table alias used in the constructed query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function update($update = null, $alias = null)
+ {
+ }
+
+ /**
+ * Turns the query being built into an insert query that inserts into
+ * a certain table
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->insert('users')
+ * ->values(
+ * array(
+ * 'name' => '?',
+ * 'password' => '?'
+ * )
+ * );
+ *
+ *
+ * @param string $insert The table into which the rows should be inserted.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function insert($insert = null)
+ {
+ }
+
+ /**
+ * Creates and adds a query root corresponding to the table identified by the
+ * given alias, forming a cartesian product with any existing query roots.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.id')
+ * ->from('users', 'u')
+ *
+ *
+ * @param string $from The table.
+ * @param string|null $alias The alias of the table.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function from($from, $alias = null)
+ {
+ }
+
+ /**
+ * Creates and adds a join to the query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->join('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function join($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Creates and adds a join to the query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->innerJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function innerJoin($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Creates and adds a left join to the query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function leftJoin($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Creates and adds a right join to the query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function rightJoin($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Sets a new value for a column in a bulk update query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->update('counters', 'c')
+ * ->set('c.value', 'c.value + 1')
+ * ->where('c.id = ?');
+ *
+ *
+ * @param string $key The column to set.
+ * @param string $value The value, expression, placeholder, etc.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function set($key, $value)
+ {
+ }
+
+ /**
+ * Specifies one or more restrictions to the query result.
+ * Replaces any previously specified restrictions, if any.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('c.value')
+ * ->from('counters', 'c')
+ * ->where('c.id = ?');
+ *
+ * // You can optionally programmatically build and/or expressions
+ * $qb = $conn->createQueryBuilder();
+ *
+ * $or = $qb->expr()->orx();
+ * $or->add($qb->expr()->eq('c.id', 1));
+ * $or->add($qb->expr()->eq('c.id', 2));
+ *
+ * $qb->update('counters', 'c')
+ * ->set('c.value', 'c.value + 1')
+ * ->where($or);
+ *
+ *
+ * @param mixed $predicates The restriction predicates.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function where($predicates)
+ {
+ }
+
+ /**
+ * Adds one or more restrictions to the query results, forming a logical
+ * conjunction with any previously specified restrictions.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where('u.username LIKE ?')
+ * ->andWhere('u.is_active = 1');
+ *
+ *
+ * @see where()
+ *
+ * @param mixed $where The query restrictions.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function andWhere($where)
+ {
+ }
+
+ /**
+ * Adds one or more restrictions to the query results, forming a logical
+ * disjunction with any previously specified restrictions.
+ *
+ *
+ * $qb = $em->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->where('u.id = 1')
+ * ->orWhere('u.id = 2');
+ *
+ *
+ * @see where()
+ *
+ * @param mixed $where The WHERE statement.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function orWhere($where)
+ {
+ }
+
+ /**
+ * Specifies a grouping over the results of the query.
+ * Replaces any previously specified groupings, if any.
+ *
+ * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->groupBy('u.id');
+ *
+ *
+ * @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED.
+ * Pass each value as an individual argument.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function groupBy($groupBy)
+ {
+ }
+
+ /**
+ * Adds a grouping expression to the query.
+ *
+ * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->groupBy('u.lastLogin')
+ * ->addGroupBy('u.createdAt');
+ *
+ *
+ * @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED.
+ * Pass each value as an individual argument.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function addGroupBy($groupBy)
+ {
+ }
+
+ /**
+ * Sets a value for a column in an insert query.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->insert('users')
+ * ->values(
+ * array(
+ * 'name' => '?'
+ * )
+ * )
+ * ->setValue('password', '?');
+ *
+ *
+ * @param string $column The column into which the value should be inserted.
+ * @param string $value The value that should be inserted into the column.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setValue($column, $value)
+ {
+ }
+
+ /**
+ * Specifies values for an insert query indexed by column names.
+ * Replaces any previous values, if any.
+ *
+ *
+ * $qb = $conn->createQueryBuilder()
+ * ->insert('users')
+ * ->values(
+ * array(
+ * 'name' => '?',
+ * 'password' => '?'
+ * )
+ * );
+ *
+ *
+ * @param mixed[] $values The values to specify for the insert query indexed by column names.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function values(array $values)
+ {
+ }
+
+ /**
+ * Specifies a restriction over the groups of the query.
+ * Replaces any previous having restrictions, if any.
+ *
+ * @param mixed $having The restriction over the groups.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function having($having)
+ {
+ }
+
+ /**
+ * Adds a restriction over the groups of the query, forming a logical
+ * conjunction with any existing having restrictions.
+ *
+ * @param mixed $having The restriction to append.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function andHaving($having)
+ {
+ }
+
+ /**
+ * Adds a restriction over the groups of the query, forming a logical
+ * disjunction with any existing having restrictions.
+ *
+ * @param mixed $having The restriction to add.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function orHaving($having)
+ {
+ }
+
+ /**
+ * Specifies an ordering for the query results.
+ * Replaces any previously specified orderings, if any.
+ *
+ * @param string $sort The ordering expression.
+ * @param string $order The ordering direction.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function orderBy($sort, $order = null)
+ {
+ }
+
+ /**
+ * Adds an ordering to the query results.
+ *
+ * @param string $sort The ordering expression.
+ * @param string $order The ordering direction.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function addOrderBy($sort, $order = null)
+ {
+ }
+
+ /**
+ * Gets a query part by its name.
+ *
+ * @deprecated The query parts are implementation details and should not be relied upon.
+ *
+ * @param string $queryPartName
+ *
+ * @return mixed
+ */
+ public function getQueryPart($queryPartName)
+ {
+ }
+
+ /**
+ * Gets all query parts.
+ *
+ * @deprecated The query parts are implementation details and should not be relied upon.
+ *
+ * @return mixed[]
+ */
+ public function getQueryParts()
+ {
+ }
+
+ /**
+ * Resets SQL parts.
+ *
+ * @deprecated Use the dedicated reset*() methods instead.
+ *
+ * @param string[]|null $queryPartNames
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function resetQueryParts($queryPartNames = null)
+ {
+ }
+
+ /**
+ * Resets a single SQL part.
+ *
+ * @deprecated Use the dedicated reset*() methods instead.
+ *
+ * @param string $queryPartName
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function resetQueryPart($queryPartName)
+ {
+ }
+
+ /**
+ * Resets the WHERE conditions for the query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function resetWhere(): self
+ {
+ }
+
+ /**
+ * Resets the grouping for the query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function resetGroupBy(): self
+ {
+ }
+
+ /**
+ * Resets the HAVING conditions for the query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function resetHaving(): self
+ {
+ }
+
+ /**
+ * Resets the ordering for the query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function resetOrderBy(): self
+ {
+ }
+
+ /**
+ * Gets a string representation of this QueryBuilder which corresponds to
+ * the final SQL query being constructed.
+ *
+ * @return string The string representation of this QueryBuilder.
+ */
+ public function __toString()
+ {
+ }
+
+ /**
+ * Creates a new named parameter and bind the value $value to it.
+ *
+ * This method provides a shortcut for {@see Statement::bindValue()}
+ * when using prepared statements.
+ *
+ * The parameter $value specifies the value that you want to bind. If
+ * $placeholder is not provided createNamedParameter() will automatically
+ * create a placeholder for you. An automatic placeholder will be of the
+ * name ':dcValue1', ':dcValue2' etc.
+ *
+ * Example:
+ *
+ * $value = 2;
+ * $q->eq( 'id', $q->createNamedParameter( $value ) );
+ * $stmt = $q->executeQuery(); // executed with 'id = 2'
+ *
+ *
+ * @link http://www.zetacomponents.org
+ *
+ * @param mixed $value
+ * @param int|string|Type|null $type
+ * @param string $placeHolder The name to bind with. The string must start with a colon ':'.
+ *
+ * @return string the placeholder name used.
+ */
+ public function createNamedParameter($value, $type = ParameterType::STRING, $placeHolder = null)
+ {
+ }
+
+ /**
+ * Creates a new positional parameter and bind the given value to it.
+ *
+ * Attention: If you are using positional parameters with the query builder you have
+ * to be very careful to bind all parameters in the order they appear in the SQL
+ * statement , otherwise they get bound in the wrong order which can lead to serious
+ * bugs in your code.
+ *
+ * Example:
+ *
+ * $qb = $conn->createQueryBuilder();
+ * $qb->select('u.*')
+ * ->from('users', 'u')
+ * ->where('u.username = ' . $qb->createPositionalParameter('Foo', ParameterType::STRING))
+ * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', ParameterType::STRING))
+ *
+ *
+ * @param mixed $value
+ * @param int|string|Type|null $type
+ *
+ * @return string
+ */
+ public function createPositionalParameter($value, $type = ParameterType::STRING)
+ {
+ }
+
+ /**
+ * Deep clone of all expression objects in the SQL parts.
+ *
+ * @return void
+ */
+ public function __clone()
+ {
+ }
+
+ /**
+ * Enables caching of the results of this query, for given amount of seconds
+ * and optionally specified which key to use for the cache entry.
+ *
+ * @return $this
+ */
+ public function enableResultCache(QueryCacheProfile $cacheProfile): self
+ {
+ }
+
+ /**
+ * Disables caching of the results of this query.
+ *
+ * @return $this
+ */
+ public function disableResultCache(): self
+ {
+ }
+}
diff --git a/tests/stubs/doctrine_dbal_schema_abstractasset.php b/tests/stubs/doctrine_dbal_schema_abstractasset.php
new file mode 100644
index 000000000..36e8fdb9b
--- /dev/null
+++ b/tests/stubs/doctrine_dbal_schema_abstractasset.php
@@ -0,0 +1,171 @@
+ Table($tableName)); if you want to rename the table, you have to make sure this does not get
+ * recreated during schema migration.
+ */
+abstract class AbstractAsset
+{
+ /** @var string */
+ protected $_name = '';
+
+ /**
+ * Namespace of the asset. If none isset the default namespace is assumed.
+ *
+ * @var string|null
+ */
+ protected $_namespace;
+
+ /** @var bool */
+ protected $_quoted = false;
+
+ /**
+ * Sets the name of this asset.
+ *
+ * @param string $name
+ *
+ * @return void
+ */
+ protected function _setName($name)
+ {
+ }
+
+ /**
+ * Is this asset in the default namespace?
+ *
+ * @param string $defaultNamespaceName
+ *
+ * @return bool
+ */
+ public function isInDefaultNamespace($defaultNamespaceName)
+ {
+ }
+
+ /**
+ * Gets the namespace name of this asset.
+ *
+ * If NULL is returned this means the default namespace is used.
+ *
+ * @return string|null
+ */
+ public function getNamespaceName()
+ {
+ }
+
+ /**
+ * The shortest name is stripped of the default namespace. All other
+ * namespaced elements are returned as full-qualified names.
+ *
+ * @param string|null $defaultNamespaceName
+ *
+ * @return string
+ */
+ public function getShortestName($defaultNamespaceName)
+ {
+ }
+
+ /**
+ * The normalized name is full-qualified and lower-cased. Lower-casing is
+ * actually wrong, but we have to do it to keep our sanity. If you are
+ * using database objects that only differentiate in the casing (FOO vs
+ * Foo) then you will NOT be able to use Doctrine Schema abstraction.
+ *
+ * Every non-namespaced element is prefixed with the default namespace
+ * name which is passed as argument to this method.
+ *
+ * @deprecated Use {@see getNamespaceName()} and {@see getName()} instead.
+ *
+ * @param string $defaultNamespaceName
+ *
+ * @return string
+ */
+ public function getFullQualifiedName($defaultNamespaceName)
+ {
+ }
+
+ /**
+ * Checks if this asset's name is quoted.
+ *
+ * @return bool
+ */
+ public function isQuoted()
+ {
+ }
+
+ /**
+ * Checks if this identifier is quoted.
+ *
+ * @param string $identifier
+ *
+ * @return bool
+ */
+ protected function isIdentifierQuoted($identifier)
+ {
+ }
+
+ /**
+ * Trim quotes from the identifier.
+ *
+ * @param string $identifier
+ *
+ * @return string
+ */
+ protected function trimQuotes($identifier)
+ {
+ }
+
+ /**
+ * Returns the name of this schema asset.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ }
+
+ /**
+ * Gets the quoted representation of this asset but only if it was defined with one. Otherwise
+ * return the plain unquoted value as inserted.
+ *
+ * @return string
+ */
+ public function getQuotedName(AbstractPlatform $platform)
+ {
+ }
+
+ /**
+ * Generates an identifier from a list of column names obeying a certain string length.
+ *
+ * This is especially important for Oracle, since it does not allow identifiers larger than 30 chars,
+ * however building idents automatically for foreign keys, composite keys or such can easily create
+ * very long names.
+ *
+ * @param string[] $columnNames
+ * @param string $prefix
+ * @param int $maxSize
+ *
+ * @return string
+ */
+ protected function _generateIdentifierName($columnNames, $prefix = '', $maxSize = 30)
+ {
+ }
+}
diff --git a/tests/stubs/doctrine_dbal_schema_constraint.php b/tests/stubs/doctrine_dbal_schema_constraint.php
new file mode 100644
index 000000000..977468928
--- /dev/null
+++ b/tests/stubs/doctrine_dbal_schema_constraint.php
@@ -0,0 +1,49 @@
+ Identifier)
+ *
+ * @var Identifier[]
+ */
+ protected $_columns = [];
+
+ /** @var bool */
+ protected $_isUnique = false;
+
+ /** @var bool */
+ protected $_isPrimary = false;
+
+ /**
+ * Platform specific flags for indexes.
+ * array($flagName => true)
+ *
+ * @var true[]
+ */
+ protected $_flags = [];
+
+ /**
+ * @param string $name
+ * @param string[] $columns
+ * @param bool $isUnique
+ * @param bool $isPrimary
+ * @param string[] $flags
+ * @param mixed[] $options
+ */
+ public function __construct($name, array $columns, $isUnique = false, $isPrimary = false, array $flags = [], array $options = [])
+ {
+ }
+
+ /** @throws InvalidArgumentException */
+ protected function _addColumn(string $column): void
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getColumns()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getQuotedColumns(AbstractPlatform $platform)
+ {
+ }
+
+ /** @return string[] */
+ public function getUnquotedColumns()
+ {
+ }
+
+ /**
+ * Is the index neither unique nor primary key?
+ *
+ * @return bool
+ */
+ public function isSimpleIndex()
+ {
+ }
+
+ /** @return bool */
+ public function isUnique()
+ {
+ }
+
+ /** @return bool */
+ public function isPrimary()
+ {
+ }
+
+ /**
+ * @param string $name
+ * @param int $pos
+ *
+ * @return bool
+ */
+ public function hasColumnAtPosition($name, $pos = 0)
+ {
+ }
+
+ /**
+ * Checks if this index exactly spans the given column names in the correct order.
+ *
+ * @param string[] $columnNames
+ *
+ * @return bool
+ */
+ public function spansColumns(array $columnNames)
+ {
+ }
+
+ /**
+ * Keeping misspelled function name for backwards compatibility
+ *
+ * @deprecated Use {@see isFulfilledBy()} instead.
+ *
+ * @return bool
+ */
+ public function isFullfilledBy(Index $other)
+ {
+ }
+
+ /**
+ * Checks if the other index already fulfills all the indexing and constraint needs of the current one.
+ */
+ public function isFulfilledBy(Index $other): bool
+ {
+ }
+
+ /**
+ * Detects if the other index is a non-unique, non primary index that can be overwritten by this one.
+ *
+ * @return bool
+ */
+ public function overrules(Index $other)
+ {
+ }
+
+ /**
+ * Returns platform specific flags for indexes.
+ *
+ * @return string[]
+ */
+ public function getFlags()
+ {
+ }
+
+ /**
+ * Adds Flag for an index that translates to platform specific handling.
+ *
+ * @param string $flag
+ *
+ * @return Index
+ *
+ * @example $index->addFlag('CLUSTERED')
+ */
+ public function addFlag($flag)
+ {
+ }
+
+ /**
+ * Does this index have a specific flag?
+ *
+ * @param string $flag
+ *
+ * @return bool
+ */
+ public function hasFlag($flag)
+ {
+ }
+
+ /**
+ * Removes a flag.
+ *
+ * @param string $flag
+ *
+ * @return void
+ */
+ public function removeFlag($flag)
+ {
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function hasOption($name)
+ {
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return mixed
+ */
+ public function getOption($name)
+ {
+ }
+
+ /** @return mixed[] */
+ public function getOptions()
+ {
+ }
+}
diff --git a/tests/stubs/doctrine_dbal_schema_schemaexception.php b/tests/stubs/doctrine_dbal_schema_schemaexception.php
new file mode 100644
index 000000000..c24f9a6e9
--- /dev/null
+++ b/tests/stubs/doctrine_dbal_schema_schemaexception.php
@@ -0,0 +1,188 @@
+ [],
+ ];
+
+ /** @var SchemaConfig|null */
+ protected $_schemaConfig;
+
+ /**
+ * @param Column[] $columns
+ * @param Index[] $indexes
+ * @param UniqueConstraint[] $uniqueConstraints
+ * @param ForeignKeyConstraint[] $fkConstraints
+ * @param mixed[] $options
+ *
+ * @throws SchemaException
+ * @throws Exception
+ */
+ public function __construct(string $name, array $columns = [], array $indexes = [], array $uniqueConstraints = [], array $fkConstraints = [], array $options = [])
+ {
+ }
+
+ /** @return void */
+ public function setSchemaConfig(SchemaConfig $schemaConfig)
+ {
+ }
+
+ /** @return int */
+ protected function _getMaxIdentifierLength()
+ {
+ }
+
+ /**
+ * Sets the Primary Key.
+ *
+ * @param string[] $columnNames
+ * @param string|false $indexName
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ public function setPrimaryKey(array $columnNames, $indexName = false)
+ {
+ }
+
+ /**
+ * @param string[] $columnNames
+ * @param string[] $flags
+ * @param mixed[] $options
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ public function addIndex(array $columnNames, ?string $indexName = null, array $flags = [], array $options = [])
+ {
+ }
+
+ /**
+ * @param string[] $columnNames
+ * @param string[] $flags
+ * @param mixed[] $options
+ *
+ * @return self
+ */
+ public function addUniqueConstraint(array $columnNames, ?string $indexName = null, array $flags = [], array $options = []): Table
+ {
+ }
+
+ /**
+ * Drops the primary key from this table.
+ *
+ * @return void
+ *
+ * @throws SchemaException
+ */
+ public function dropPrimaryKey()
+ {
+ }
+
+ /**
+ * Drops an index from this table.
+ *
+ * @param string $name The index name.
+ *
+ * @return void
+ *
+ * @throws SchemaException If the index does not exist.
+ */
+ public function dropIndex($name)
+ {
+ }
+
+ /**
+ * @param string[] $columnNames
+ * @param string|null $indexName
+ * @param mixed[] $options
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ public function addUniqueIndex(array $columnNames, $indexName = null, array $options = [])
+ {
+ }
+
+ /**
+ * Renames an index.
+ *
+ * @param string $oldName The name of the index to rename from.
+ * @param string|null $newName The name of the index to rename to.
+ * If null is given, the index name will be auto-generated.
+ *
+ * @return self This table instance.
+ *
+ * @throws SchemaException If no index exists for the given current name
+ * or if an index with the given new name already exists on this table.
+ */
+ public function renameIndex($oldName, $newName = null)
+ {
+ }
+
+ /**
+ * Checks if an index begins in the order of the given columns.
+ *
+ * @param string[] $columnNames
+ *
+ * @return bool
+ */
+ public function columnsAreIndexed(array $columnNames)
+ {
+ }
+
+ /**
+ * @param string $name
+ * @param string $typeName
+ * @param mixed[] $options
+ *
+ * @return Column
+ *
+ * @throws SchemaException
+ */
+ public function addColumn($name, $typeName, array $options = [])
+ {
+ }
+
+ /**
+ * Change Column Details.
+ *
+ * @deprecated Use {@link modifyColumn()} instead.
+ *
+ * @param string $name
+ * @param mixed[] $options
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ public function changeColumn($name, array $options)
+ {
+ }
+
+ /**
+ * @param string $name
+ * @param mixed[] $options
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ public function modifyColumn($name, array $options)
+ {
+ }
+
+ /**
+ * Drops a Column from the Table.
+ *
+ * @param string $name
+ *
+ * @return self
+ */
+ public function dropColumn($name)
+ {
+ }
+
+ /**
+ * Adds a foreign key constraint.
+ *
+ * Name is inferred from the local columns.
+ *
+ * @param Table|string $foreignTable Table schema instance or table name
+ * @param string[] $localColumnNames
+ * @param string[] $foreignColumnNames
+ * @param mixed[] $options
+ * @param string|null $name
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ public function addForeignKeyConstraint($foreignTable, array $localColumnNames, array $foreignColumnNames, array $options = [], $name = null)
+ {
+ }
+
+ /**
+ * @param string $name
+ * @param mixed $value
+ *
+ * @return self
+ */
+ public function addOption($name, $value)
+ {
+ }
+
+ /**
+ * @return void
+ *
+ * @throws SchemaException
+ */
+ protected function _addColumn(Column $column)
+ {
+ }
+
+ /**
+ * Adds an index to the table.
+ *
+ * @return self
+ *
+ * @throws SchemaException
+ */
+ protected function _addIndex(Index $indexCandidate)
+ {
+ }
+
+ /** @return self */
+ protected function _addUniqueConstraint(UniqueConstraint $constraint): Table
+ {
+ }
+
+ /** @return self */
+ protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint)
+ {
+ }
+
+ /**
+ * Returns whether this table has a foreign key constraint with the given name.
+ *
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function hasForeignKey($name)
+ {
+ }
+
+ /**
+ * Returns the foreign key constraint with the given name.
+ *
+ * @param string $name The constraint name.
+ *
+ * @return ForeignKeyConstraint
+ *
+ * @throws SchemaException If the foreign key does not exist.
+ */
+ public function getForeignKey($name)
+ {
+ }
+
+ /**
+ * Removes the foreign key constraint with the given name.
+ *
+ * @param string $name The constraint name.
+ *
+ * @return void
+ *
+ * @throws SchemaException
+ */
+ public function removeForeignKey($name)
+ {
+ }
+
+ /**
+ * Returns whether this table has a unique constraint with the given name.
+ */
+ public function hasUniqueConstraint(string $name): bool
+ {
+ }
+
+ /**
+ * Returns the unique constraint with the given name.
+ *
+ * @throws SchemaException If the unique constraint does not exist.
+ */
+ public function getUniqueConstraint(string $name): UniqueConstraint
+ {
+ }
+
+ /**
+ * Removes the unique constraint with the given name.
+ *
+ * @throws SchemaException If the unique constraint does not exist.
+ */
+ public function removeUniqueConstraint(string $name): void
+ {
+ }
+
+ /**
+ * Returns ordered list of columns (primary keys are first, then foreign keys, then the rest)
+ *
+ * @return Column[]
+ */
+ public function getColumns()
+ {
+ }
+
+ /**
+ * Returns the foreign key columns
+ *
+ * @deprecated Use {@see getForeignKey()} and {@see ForeignKeyConstraint::getLocalColumns()} instead.
+ *
+ * @return Column[]
+ */
+ public function getForeignKeyColumns()
+ {
+ }
+
+ /**
+ * Returns whether this table has a Column with the given name.
+ *
+ * @param string $name The column name.
+ *
+ * @return bool
+ */
+ public function hasColumn($name)
+ {
+ }
+
+ /**
+ * Returns the Column with the given name.
+ *
+ * @param string $name The column name.
+ *
+ * @return Column
+ *
+ * @throws SchemaException If the column does not exist.
+ */
+ public function getColumn($name)
+ {
+ }
+
+ /**
+ * Returns the primary key.
+ *
+ * @return Index|null The primary key, or null if this Table has no primary key.
+ */
+ public function getPrimaryKey()
+ {
+ }
+
+ /**
+ * Returns the primary key columns.
+ *
+ * @deprecated Use {@see getPrimaryKey()} and {@see Index::getColumns()} instead.
+ *
+ * @return Column[]
+ *
+ * @throws Exception
+ */
+ public function getPrimaryKeyColumns()
+ {
+ }
+
+ /**
+ * Returns whether this table has a primary key.
+ *
+ * @deprecated Use {@see getPrimaryKey()} instead.
+ *
+ * @return bool
+ */
+ public function hasPrimaryKey()
+ {
+ }
+
+ /**
+ * Returns whether this table has an Index with the given name.
+ *
+ * @param string $name The index name.
+ *
+ * @return bool
+ */
+ public function hasIndex($name)
+ {
+ }
+
+ /**
+ * Returns the Index with the given name.
+ *
+ * @param string $name The index name.
+ *
+ * @return Index
+ *
+ * @throws SchemaException If the index does not exist.
+ */
+ public function getIndex($name)
+ {
+ }
+
+ /** @return Index[] */
+ public function getIndexes()
+ {
+ }
+
+ /**
+ * Returns the unique constraints.
+ *
+ * @return UniqueConstraint[]
+ */
+ public function getUniqueConstraints(): array
+ {
+ }
+
+ /**
+ * Returns the foreign key constraints.
+ *
+ * @return ForeignKeyConstraint[]
+ */
+ public function getForeignKeys()
+ {
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function hasOption($name)
+ {
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return mixed
+ */
+ public function getOption($name)
+ {
+ }
+
+ /** @return mixed[] */
+ public function getOptions()
+ {
+ }
+
+ /**
+ * @deprecated
+ *
+ * @return void
+ *
+ * @throws SchemaException
+ */
+ public function visit(Visitor $visitor)
+ {
+ }
+
+ /**
+ * Clone of a Table triggers a deep clone of all affected assets.
+ *
+ * @return void
+ */
+ public function __clone()
+ {
+ }
+
+ public function setComment(?string $comment): self
+ {
+ }
+
+ public function getComment(): ?string
+ {
+ }
+}
diff --git a/tests/stubs/oc.php b/tests/stubs/oc.php
new file mode 100644
index 000000000..3a4a1c59a
--- /dev/null
+++ b/tests/stubs/oc.php
@@ -0,0 +1,151 @@
+ filename
+ */
+ public static array $CLASSPATH = [];
+ /**
+ * The installation path for Nextcloud on the server (e.g. /srv/http/nextcloud)
+ */
+ public static string $SERVERROOT = '';
+ /**
+ * the Nextcloud root path for http requests (e.g. /nextcloud)
+ */
+ public static string $WEBROOT = '';
+ /**
+ * The installation path array of the apps folder on the server (e.g. /srv/http/nextcloud) 'path' and
+ * web path in 'url'
+ */
+ public static array $APPSROOTS = [];
+
+ public static string $configDir;
+
+ /**
+ * requested app
+ */
+ public static string $REQUESTEDAPP = '';
+
+ /**
+ * check if Nextcloud runs in cli mode
+ */
+ public static bool $CLI = false;
+
+ public static \OC\Autoloader $loader;
+
+ public static \Composer\Autoload\ClassLoader $composerAutoloader;
+
+ public static \OC\Server $server;
+
+ /**
+ * @throws \RuntimeException when the 3rdparty directory is missing or
+ * the app path list is empty or contains an invalid path
+ */
+ public static function initPaths(): void
+ {
+ }
+
+ public static function checkConfig(): void
+ {
+ }
+
+ public static function checkInstalled(\OC\SystemConfig $systemConfig): void
+ {
+ }
+
+ public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig): void
+ {
+ }
+
+ public static function initSession(): void
+ {
+ }
+
+ /**
+ * @return bool true if the session expiry should only be done by gc instead of an explicit timeout
+ */
+ public static function hasSessionRelaxedExpiry(): bool
+ {
+ }
+
+ /**
+ * Try to set some values to the required Nextcloud default
+ */
+ public static function setRequiredIniValues(): void
+ {
+ }
+
+ public static function init(): void
+ {
+ }
+
+ /**
+ * register hooks for the cleanup of cache and bruteforce protection
+ */
+ public static function registerCleanupHooks(\OC\SystemConfig $systemConfig): void
+ {
+ }
+
+ /**
+ * register hooks for sharing
+ */
+ public static function registerShareHooks(\OC\SystemConfig $systemConfig): void
+ {
+ }
+
+ protected static function registerAutoloaderCache(\OC\SystemConfig $systemConfig): void
+ {
+ }
+
+ /**
+ * Handle the request
+ */
+ public static function handleRequest(): void
+ {
+ }
+
+ /**
+ * Check login: apache auth, auth token, basic auth
+ */
+ public static function handleLogin(OCP\IRequest $request): bool
+ {
+ }
+
+ protected static function handleAuthHeaders(): void
+ {
+ }
+
+ protected static function tryAppAPILogin(OCP\IRequest $request): bool
+ {
+ }
+}
+
+OC::init();
diff --git a/tests/stubs/oc_appframework_bootstrap_aregistration.php b/tests/stubs/oc_appframework_bootstrap_aregistration.php
new file mode 100644
index 000000000..775ffe867
--- /dev/null
+++ b/tests/stubs/oc_appframework_bootstrap_aregistration.php
@@ -0,0 +1,25 @@
+ $capability
+ */
+ public function registerCapability(string $appId, string $capability): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $reporterClass
+ */
+ public function registerCrashReporter(string $appId, string $reporterClass): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $panelClass
+ */
+ public function registerDashboardPanel(string $appId, string $panelClass): void
+ {
+ }
+
+ public function registerService(string $appId, string $name, callable $factory, bool $shared = true): void
+ {
+ }
+
+ public function registerServiceAlias(string $appId, string $alias, string $target): void
+ {
+ }
+
+ public function registerParameter(string $appId, string $name, $value): void
+ {
+ }
+
+ public function registerEventListener(string $appId, string $event, string $listener, int $priority = 0): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $class
+ */
+ public function registerMiddleware(string $appId, string $class, bool $global): void
+ {
+ }
+
+ public function registerSearchProvider(string $appId, string $class)
+ {
+ }
+
+ public function registerAlternativeLogin(string $appId, string $class): void
+ {
+ }
+
+ public function registerInitialState(string $appId, string $class): void
+ {
+ }
+
+ public function registerWellKnown(string $appId, string $class): void
+ {
+ }
+
+ public function registerSpeechToTextProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerTextProcessingProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerTextToImageProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerTemplateProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerTranslationProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerNotifierService(string $appId, string $class): void
+ {
+ }
+
+ public function registerTwoFactorProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerPreviewProvider(string $appId, string $class, string $mimeTypeRegex): void
+ {
+ }
+
+ public function registerCalendarProvider(string $appId, string $class): void
+ {
+ }
+
+ public function registerReferenceProvider(string $appId, string $class): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $actionClass
+ */
+ public function registerProfileLinkAction(string $appId, string $actionClass): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $backend
+ */
+ public function registerTalkBackend(string $appId, string $backend)
+ {
+ }
+
+ public function registerCalendarResourceBackend(string $appId, string $class)
+ {
+ }
+
+ public function registerCalendarRoomBackend(string $appId, string $class)
+ {
+ }
+
+ /**
+ * @psalm-param class-string $class
+ */
+ public function registerTeamResourceProvider(string $appId, string $class)
+ {
+ }
+
+ /**
+ * @psalm-param class-string $migratorClass
+ */
+ public function registerUserMigrator(string $appId, string $migratorClass): void
+ {
+ }
+
+ public function registerSensitiveMethods(string $appId, string $class, array $methods): void
+ {
+ }
+
+ public function registerPublicShareTemplateProvider(string $appId, string $class): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $setupCheckClass
+ */
+ public function registerSetupCheck(string $appId, string $setupCheckClass): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $declarativeSettingsClass
+ */
+ public function registerDeclarativeSettings(string $appId, string $declarativeSettingsClass): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string<\OCP\TaskProcessing\IProvider> $declarativeSettingsClass
+ */
+ public function registerTaskProcessingProvider(string $appId, string $taskProcessingProviderClass): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string<\OCP\TaskProcessing\ITaskType> $declarativeSettingsClass
+ */
+ public function registerTaskProcessingTaskType(string $appId, string $taskProcessingTaskTypeClass)
+ {
+ }
+
+ /**
+ * @psalm-param class-string<\OCP\Files\Conversion\IConversionProvider> $class
+ */
+ public function registerFileConversionProvider(string $appId, string $class): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $migratorClass
+ */
+ public function registerMailProvider(string $appId, string $class): void
+ {
+ }
+
+ /**
+ * @psalm-param class-string $configLexiconClass
+ */
+ public function registerConfigLexicon(string $appId, string $configLexiconClass): void
+ {
+ }
+
+ /**
+ * @param App[] $apps
+ */
+ public function delegateCapabilityRegistrations(array $apps): void
+ {
+ }
+
+ /**
+ * @param App[] $apps
+ */
+ public function delegateCrashReporterRegistrations(array $apps, Registry $registry): void
+ {
+ }
+
+ public function delegateDashboardPanelRegistrations(IManager $dashboardManager): void
+ {
+ }
+
+ public function delegateEventListenerRegistrations(IEventDispatcher $eventDispatcher): void
+ {
+ }
+
+ /**
+ * @param App[] $apps
+ */
+ public function delegateContainerRegistrations(array $apps): void
+ {
+ }
+
+ /**
+ * @return MiddlewareRegistration[]
+ */
+ public function getMiddlewareRegistrations(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getSearchProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getAlternativeLogins(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getInitialStates(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getWellKnownHandlers(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getSpeechToTextProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getTextProcessingProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration<\OCP\TextToImage\IProvider>[]
+ */
+ public function getTextToImageProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getTemplateProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getTranslationProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getNotifierServices(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[]
+ */
+ public function getTwoFactorProviders(): array
+ {
+ }
+
+ /**
+ * @return PreviewProviderRegistration[]
+ */
+ public function getPreviewProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getCalendarProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getReferenceProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getProfileLinkActions(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration|null
+ * @psalm-return ServiceRegistration|null
+ */
+ public function getTalkBackendRegistration(): ?ServiceRegistration
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ * @psalm-return ServiceRegistration[]
+ */
+ public function getCalendarResourceBackendRegistrations(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ * @psalm-return ServiceRegistration[]
+ */
+ public function getCalendarRoomBackendRegistrations(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getUserMigrators(): array
+ {
+ }
+
+ /**
+ * @return ParameterRegistration[]
+ */
+ public function getSensitiveMethods(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getPublicShareTemplateProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getSetupChecks(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getTeamResourceProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getDeclarativeSettings(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration<\OCP\TaskProcessing\IProvider>[]
+ */
+ public function getTaskProcessingProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration<\OCP\TaskProcessing\ITaskType>[]
+ */
+ public function getTaskProcessingTaskTypes(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration<\OCP\Files\Conversion\IConversionProvider>[]
+ */
+ public function getFileConversionProviders(): array
+ {
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ */
+ public function getMailProviders(): array
+ {
+ }
+
+ /**
+ * returns IConfigLexicon registered by the app.
+ * null if none registered.
+ *
+ * @param string $appId
+ *
+ * @return IConfigLexicon|null
+ */
+ public function getConfigLexicon(string $appId): ?IConfigLexicon
+ {
+ }
+}
diff --git a/tests/stubs/oc_appframework_bootstrap_serviceregistration.php b/tests/stubs/oc_appframework_bootstrap_serviceregistration.php
new file mode 100644
index 000000000..5c7b71de4
--- /dev/null
+++ b/tests/stubs/oc_appframework_bootstrap_serviceregistration.php
@@ -0,0 +1,29 @@
+ $service
+ */
+ public function __construct(string $appId, string $service)
+ {
+ }
+
+ /**
+ * @psalm-return class-string
+ */
+ public function getService(): string
+ {
+ }
+}
diff --git a/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php b/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php
new file mode 100644
index 000000000..5ea2900e0
--- /dev/null
+++ b/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php
@@ -0,0 +1,22 @@
+|string $id
+ * @return T|mixed
+ * @psalm-template S as class-string|string
+ * @psalm-param S $id
+ * @psalm-return (S is class-string ? T : mixed)
+ */
+ public function get(string $id): mixed
+ {
+ }
+
+ public function has(string $id): bool
+ {
+ }
+
+ public function resolve($name)
+ {
+ }
+
+ public function query(string $name, bool $autoload = true)
+ {
+ }
+
+ /**
+ * @param string $name
+ * @param mixed $value
+ */
+ public function registerParameter($name, $value)
+ {
+ }
+
+ /**
+ * The given closure is call the first time the given service is queried.
+ * The closure has to return the instance for the given service.
+ * Created instance will be cached in case $shared is true.
+ *
+ * @param string $name name of the service to register another backend for
+ * @param Closure $closure the closure to be called on service creation
+ * @param bool $shared
+ */
+ public function registerService($name, Closure $closure, $shared = true)
+ {
+ }
+
+ /**
+ * Shortcut for returning a service from a service under a different key,
+ * e.g. to tell the container to return a class when queried for an
+ * interface
+ * @param string $alias the alias that should be registered
+ * @param string $target the target that should be resolved instead
+ */
+ public function registerAlias($alias, $target)
+ {
+ }
+
+ /*
+ * @param string $name
+ * @return string
+ */
+ protected function sanitizeName($name)
+ {
+ }
+
+ /**
+ * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::has
+ */
+ public function offsetExists($id): bool
+ {
+ }
+
+ /**
+ * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
+ * @return mixed
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($id)
+ {
+ }
+
+ /**
+ * @deprecated 20.0.0 use \OCP\IContainer::registerService
+ */
+ public function offsetSet($offset, $value): void
+ {
+ }
+
+ /**
+ * @deprecated 20.0.0
+ */
+ public function offsetUnset($offset): void
+ {
+ }
+}
diff --git a/tests/stubs/oc_core_command_base.php b/tests/stubs/oc_core_command_base.php
new file mode 100644
index 000000000..d398338a3
--- /dev/null
+++ b/tests/stubs/oc_core_command_base.php
@@ -0,0 +1,89 @@
+ */
+ protected $tableDirtyWrites = [];
+
+ protected bool $logDbException = false;
+
+ protected bool $logRequestId;
+ protected string $requestId;
+
+ /** @var array> */
+ protected array $partitions;
+ /** @var ShardDefinition[] */
+ protected array $shards = [];
+ protected ShardConnectionManager $shardConnectionManager;
+ protected AutoIncrementHandler $autoIncrementHandler;
+ protected bool $isShardingEnabled;
+
+ public const SHARD_PRESETS = [
+ 'filecache' => [
+ 'companion_keys' => [
+ 'file_id',
+ ],
+ 'companion_tables' => [
+ 'filecache_extended',
+ 'files_metadata',
+ ],
+ 'primary_key' => 'fileid',
+ 'shard_key' => 'storage',
+ 'table' => 'filecache',
+ ],
+ ];
+
+ /**
+ * Initializes a new instance of the Connection class.
+ *
+ * @throws \Exception
+ */
+ public function __construct(private array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null)
+ {
+ }
+
+ /**
+ * @return IDBConnection[]
+ */
+ public function getShardConnections(): array
+ {
+ }
+
+ /**
+ * @throws Exception
+ */
+ public function connect($connectionName = null)
+ {
+ }
+
+ protected function performConnect(?string $connectionName = null): bool
+ {
+ }
+
+ public function getStats(): array
+ {
+ }
+
+ /**
+ * Returns a QueryBuilder for the connection.
+ */
+ public function getQueryBuilder(): IQueryBuilder
+ {
+ }
+
+ /**
+ * Gets the QueryBuilder for the connection.
+ *
+ * @return \Doctrine\DBAL\Query\QueryBuilder
+ * @deprecated 8.0.0 please use $this->getQueryBuilder() instead
+ */
+ public function createQueryBuilder()
+ {
+ }
+
+ /**
+ * Gets the ExpressionBuilder for the connection.
+ *
+ * @return \Doctrine\DBAL\Query\Expression\ExpressionBuilder
+ * @deprecated 8.0.0 please use $this->getQueryBuilder()->expr() instead
+ */
+ public function getExpressionBuilder()
+ {
+ }
+
+ /**
+ * Get the file and line that called the method where `getCallerBacktrace()` was used
+ *
+ * @return string
+ */
+ protected function getCallerBacktrace()
+ {
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrefix()
+ {
+ }
+
+ /**
+ * Prepares an SQL statement.
+ *
+ * @param string $statement The SQL statement to prepare.
+ * @param int|null $limit
+ * @param int|null $offset
+ *
+ * @return Statement The prepared statement.
+ * @throws Exception
+ */
+ public function prepare($sql, $limit = null, $offset = null): Statement
+ {
+ }
+
+ /**
+ * Executes an, optionally parametrized, SQL query.
+ *
+ * If the query is parametrized, a prepared statement is used.
+ * If an SQLLogger is configured, the execution is logged.
+ *
+ * @param string $sql The SQL query to execute.
+ * @param array $params The parameters to bind to the query, if any.
+ * @param array $types The types the previous parameters are in.
+ * @param \Doctrine\DBAL\Cache\QueryCacheProfile|null $qcp The query cache profile, optional.
+ *
+ * @return Result The executed statement.
+ *
+ * @throws \Doctrine\DBAL\Exception
+ */
+ public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result
+ {
+ }
+
+ /**
+ * @throws Exception
+ */
+ public function executeUpdate(string $sql, array $params = [], array $types = []): int
+ {
+ }
+
+ /**
+ * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
+ * and returns the number of affected rows.
+ *
+ * This method supports PDO binding types as well as DBAL mapping types.
+ *
+ * @param string $sql The SQL query.
+ * @param array $params The query parameters.
+ * @param array $types The parameter types.
+ *
+ * @return int The number of affected rows.
+ *
+ * @throws \Doctrine\DBAL\Exception
+ */
+ public function executeStatement($sql, array $params = [], array $types = []): int
+ {
+ }
+
+ protected function logQueryToFile(string $sql): void
+ {
+ }
+
+ /**
+ * Returns the ID of the last inserted row, or the last value from a sequence object,
+ * depending on the underlying driver.
+ *
+ * Note: This method may not return a meaningful or consistent result across different drivers,
+ * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY
+ * columns or sequences.
+ *
+ * @param string $seqName Name of the sequence object from which the ID should be returned.
+ *
+ * @return int the last inserted ID.
+ * @throws Exception
+ */
+ public function lastInsertId($name = null): int
+ {
+ }
+
+ /**
+ * @internal
+ * @throws Exception
+ */
+ public function realLastInsertId($seqName = null)
+ {
+ }
+
+ /**
+ * Insert a row if the matching row does not exists. To accomplish proper race condition avoidance
+ * it is needed that there is also a unique constraint on the values. Then this method will
+ * catch the exception and return 0.
+ *
+ * @param string $table The table name (will replace *PREFIX* with the actual prefix)
+ * @param array $input data that should be inserted into the table (column name => value)
+ * @param array|null $compare List of values that should be checked for "if not exists"
+ * If this is null or an empty array, all keys of $input will be compared
+ * Please note: text fields (clob) must not be used in the compare array
+ * @return int number of inserted rows
+ * @throws \Doctrine\DBAL\Exception
+ * @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
+ */
+ public function insertIfNotExist($table, $input, ?array $compare = null)
+ {
+ }
+
+ public function insertIgnoreConflict(string $table, array $values): int
+ {
+ }
+
+ /**
+ * Insert or update a row value
+ *
+ * @param string $table
+ * @param array $keys (column name => value)
+ * @param array $values (column name => value)
+ * @param array $updatePreconditionValues ensure values match preconditions (column name => value)
+ * @return int number of new rows
+ * @throws \OCP\DB\Exception
+ * @throws PreConditionNotMetException
+ */
+ public function setValues(string $table, array $keys, array $values, array $updatePreconditionValues = []): int
+ {
+ }
+
+ /**
+ * Create an exclusive read+write lock on a table
+ *
+ * @param string $tableName
+ *
+ * @throws \BadMethodCallException When trying to acquire a second lock
+ * @throws Exception
+ * @since 9.1.0
+ */
+ public function lockTable($tableName)
+ {
+ }
+
+ /**
+ * Release a previous acquired lock again
+ *
+ * @throws Exception
+ * @since 9.1.0
+ */
+ public function unlockTable()
+ {
+ }
+
+ /**
+ * returns the error code and message as a string for logging
+ * works with DoctrineException
+ * @return string
+ */
+ public function getError()
+ {
+ }
+
+ public function errorCode()
+ {
+ }
+
+ public function errorInfo()
+ {
+ }
+
+ /**
+ * Drop a table from the database if it exists
+ *
+ * @param string $table table name without the prefix
+ *
+ * @throws Exception
+ */
+ public function dropTable($table)
+ {
+ }
+
+ /**
+ * Check if a table exists
+ *
+ * @param string $table table name without the prefix
+ *
+ * @return bool
+ * @throws Exception
+ */
+ public function tableExists($table)
+ {
+ }
+
+ protected function finishQuery(string $statement): string
+ {
+ }
+
+ // internal use
+ /**
+ * @param string $statement
+ * @return string
+ */
+ protected function replaceTablePrefix($statement)
+ {
+ }
+
+ /**
+ * Check if a transaction is active
+ *
+ * @return bool
+ * @since 8.2.0
+ */
+ public function inTransaction()
+ {
+ }
+
+ /**
+ * Escape a parameter to be used in a LIKE query
+ *
+ * @param string $param
+ * @return string
+ */
+ public function escapeLikeParameter($param)
+ {
+ }
+
+ /**
+ * Check whether or not the current database support 4byte wide unicode
+ *
+ * @return bool
+ * @since 11.0.0
+ */
+ public function supports4ByteText()
+ {
+ }
+
+
+ /**
+ * Create the schema of the connected database
+ *
+ * @return Schema
+ * @throws Exception
+ */
+ public function createSchema()
+ {
+ }
+
+ /**
+ * Migrate the database to the given schema
+ *
+ * @param Schema $toSchema
+ * @param bool $dryRun If true, will return the sql queries instead of running them.
+ *
+ * @throws Exception
+ *
+ * @return string|null Returns a string only if $dryRun is true.
+ */
+ public function migrateToSchema(Schema $toSchema, bool $dryRun = false)
+ {
+ }
+
+ public function beginTransaction()
+ {
+ }
+
+ public function commit()
+ {
+ }
+
+ public function rollBack()
+ {
+ }
+
+ /**
+ * @return IDBConnection::PLATFORM_MYSQL|IDBConnection::PLATFORM_ORACLE|IDBConnection::PLATFORM_POSTGRES|IDBConnection::PLATFORM_SQLITE
+ */
+ public function getDatabaseProvider(): string
+ {
+ }
+
+ /**
+ * @internal Should only be used inside the QueryBuilder, ExpressionBuilder and FunctionBuilder
+ * All apps and API code should not need this and instead use provided functionality from the above.
+ */
+ public function getServerVersion(): string
+ {
+ }
+
+ /**
+ * Log a database exception if enabled
+ *
+ * @param \Exception $exception
+ * @return void
+ */
+ public function logDatabaseException(\Exception $exception): void
+ {
+ }
+
+ public function getShardDefinition(string $name): ?ShardDefinition
+ {
+ }
+
+ public function getCrossShardMoveHelper(): CrossShardMoveHelper
+ {
+ }
+}
diff --git a/tests/stubs/oc_db_connectionadapter.php b/tests/stubs/oc_db_connectionadapter.php
new file mode 100644
index 000000000..f0fd908d1
--- /dev/null
+++ b/tests/stubs/oc_db_connectionadapter.php
@@ -0,0 +1,178 @@
+
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where($qb->expr()->eq('u.id', 1));
+ *
+ *
+ * For more complex expression construction, consider storing the expression
+ * builder object in a local variable.
+ *
+ * @return \OCP\DB\QueryBuilder\IExpressionBuilder
+ */
+ public function expr()
+ {
+ }
+
+ /**
+ * Gets an FunctionBuilder used for object-oriented construction of query functions.
+ * This producer method is intended for convenient inline usage. Example:
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where($qb->fun()->md5('u.id'));
+ *
+ *
+ * For more complex function construction, consider storing the function
+ * builder object in a local variable.
+ *
+ * @return \OCP\DB\QueryBuilder\IFunctionBuilder
+ */
+ public function func()
+ {
+ }
+
+ /**
+ * Gets the type of the currently built query.
+ *
+ * @return integer
+ */
+ public function getType()
+ {
+ }
+
+ /**
+ * Gets the associated DBAL Connection for this query builder.
+ *
+ * @return \OCP\IDBConnection
+ */
+ public function getConnection()
+ {
+ }
+
+ /**
+ * Gets the state of this query builder instance.
+ *
+ * @return int Always returns 0 which is former `QueryBuilder::STATE_DIRTY`
+ * @deprecated 30.0.0 This function is going to be removed with the next Doctrine/DBAL update
+ * and we can not fix this in our wrapper.
+ */
+ public function getState()
+ {
+ }
+
+ /**
+ * Executes this query using the bound parameters and their types.
+ *
+ * Uses {@see Connection::executeQuery} for select statements and {@see Connection::executeUpdate}
+ * for insert, update and delete statements.
+ *
+ * @return IResult|int
+ */
+ public function execute(?IDBConnection $connection = null)
+ {
+ }
+
+ public function executeQuery(?IDBConnection $connection = null): IResult
+ {
+ }
+
+ public function executeStatement(?IDBConnection $connection = null): int
+ {
+ }
+
+
+ /**
+ * Gets the complete SQL string formed by the current specifications of this QueryBuilder.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u')
+ * ->from('User', 'u')
+ * echo $qb->getSQL(); // SELECT u FROM User u
+ *
+ *
+ * @return string The SQL query string.
+ */
+ public function getSQL()
+ {
+ }
+
+ /**
+ * Sets a query parameter for the query being constructed.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where('u.id = :user_id')
+ * ->setParameter(':user_id', 1);
+ *
+ *
+ * @param string|integer $key The parameter position or name.
+ * @param mixed $value The parameter value.
+ * @param string|null|int $type One of the IQueryBuilder::PARAM_* constants.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setParameter($key, $value, $type = null)
+ {
+ }
+
+ /**
+ * Sets a collection of query parameters for the query being constructed.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where('u.id = :user_id1 OR u.id = :user_id2')
+ * ->setParameters(array(
+ * ':user_id1' => 1,
+ * ':user_id2' => 2
+ * ));
+ *
+ *
+ * @param array $params The query parameters to set.
+ * @param array $types The query parameters types to set.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setParameters(array $params, array $types = [])
+ {
+ }
+
+ /**
+ * Gets all defined query parameters for the query being constructed indexed by parameter index or name.
+ *
+ * @return array The currently defined query parameters indexed by parameter index or name.
+ */
+ public function getParameters()
+ {
+ }
+
+ /**
+ * Gets a (previously set) query parameter of the query being constructed.
+ *
+ * @param mixed $key The key (index or name) of the bound parameter.
+ *
+ * @return mixed The value of the bound parameter.
+ */
+ public function getParameter($key)
+ {
+ }
+
+ /**
+ * Gets all defined query parameter types for the query being constructed indexed by parameter index or name.
+ *
+ * @return array The currently defined query parameter types indexed by parameter index or name.
+ */
+ public function getParameterTypes()
+ {
+ }
+
+ /**
+ * Gets a (previously set) query parameter type of the query being constructed.
+ *
+ * @param mixed $key The key (index or name) of the bound parameter type.
+ *
+ * @return mixed The value of the bound parameter type.
+ */
+ public function getParameterType($key)
+ {
+ }
+
+ /**
+ * Sets the position of the first result to retrieve (the "offset").
+ *
+ * @param int $firstResult The first result to return.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setFirstResult($firstResult)
+ {
+ }
+
+ /**
+ * Gets the position of the first result the query object was set to retrieve (the "offset").
+ * Returns 0 if {@link setFirstResult} was not applied to this QueryBuilder.
+ *
+ * @return int The position of the first result.
+ */
+ public function getFirstResult()
+ {
+ }
+
+ /**
+ * Sets the maximum number of results to retrieve (the "limit").
+ *
+ * NOTE: Setting max results to "0" will cause mixed behaviour. While most
+ * of the databases will just return an empty result set, Oracle will return
+ * all entries.
+ *
+ * @param int|null $maxResults The maximum number of results to retrieve.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setMaxResults($maxResults)
+ {
+ }
+
+ /**
+ * Gets the maximum number of results the query object was set to retrieve (the "limit").
+ * Returns NULL if {@link setMaxResults} was not applied to this query builder.
+ *
+ * @return int|null The maximum number of results.
+ */
+ public function getMaxResults()
+ {
+ }
+
+ /**
+ * Specifies an item that is to be returned in the query result.
+ * Replaces any previously specified selections, if any.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.id', 'p.id')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id');
+ *
+ *
+ * @param mixed ...$selects The selection expressions.
+ *
+ * '@return $this This QueryBuilder instance.
+ */
+ public function select(...$selects)
+ {
+ }
+
+ /**
+ * Specifies an item that is to be returned with a different name in the query result.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->selectAlias('u.id', 'user_id')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id');
+ *
+ *
+ * @param mixed $select The selection expressions.
+ * @param string $alias The column alias used in the constructed query.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function selectAlias($select, $alias)
+ {
+ }
+
+ /**
+ * Specifies an item that is to be returned uniquely in the query result.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->selectDistinct('type')
+ * ->from('users');
+ *
+ *
+ * @param mixed $select The selection expressions.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function selectDistinct($select)
+ {
+ }
+
+ /**
+ * Adds an item that is to be returned in the query result.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.id')
+ * ->addSelect('p.id')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id');
+ *
+ *
+ * @param mixed ...$selects The selection expression.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function addSelect(...$selects)
+ {
+ }
+
+ public function getOutputColumns(): array
+ {
+ }
+
+ /**
+ * Turns the query being built into a bulk delete query that ranges over
+ * a certain table.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->delete('users', 'u')
+ * ->where('u.id = :user_id');
+ * ->setParameter(':user_id', 1);
+ *
+ *
+ * @param string $delete The table whose rows are subject to the deletion.
+ * @param string $alias The table alias used in the constructed query.
+ *
+ * @return $this This QueryBuilder instance.
+ * @since 30.0.0 Alias is deprecated and will no longer be used with the next Doctrine/DBAL update
+ */
+ public function delete($delete = null, $alias = null)
+ {
+ }
+
+ /**
+ * Turns the query being built into a bulk update query that ranges over
+ * a certain table
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->update('users', 'u')
+ * ->set('u.password', md5('password'))
+ * ->where('u.id = ?');
+ *
+ *
+ * @param string $update The table whose rows are subject to the update.
+ * @param string $alias The table alias used in the constructed query.
+ *
+ * @return $this This QueryBuilder instance.
+ * @since 30.0.0 Alias is deprecated and will no longer be used with the next Doctrine/DBAL update
+ */
+ public function update($update = null, $alias = null)
+ {
+ }
+
+ /**
+ * Turns the query being built into an insert query that inserts into
+ * a certain table
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->insert('users')
+ * ->values(
+ * array(
+ * 'name' => '?',
+ * 'password' => '?'
+ * )
+ * );
+ *
+ *
+ * @param string $insert The table into which the rows should be inserted.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function insert($insert = null)
+ {
+ }
+
+ /**
+ * Creates and adds a query root corresponding to the table identified by the
+ * given alias, forming a cartesian product with any existing query roots.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.id')
+ * ->from('users', 'u')
+ *
+ *
+ * @param string|IQueryFunction $from The table.
+ * @param string|null $alias The alias of the table.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function from($from, $alias = null)
+ {
+ }
+
+ /**
+ * Creates and adds a join to the query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->join('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string|ICompositeExpression|null $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function join($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Creates and adds a join to the query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->innerJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string|ICompositeExpression|null $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function innerJoin($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Creates and adds a left join to the query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->leftJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string|IQueryFunction $join The table name or sub-query to join.
+ * @param string $alias The alias of the join table.
+ * @param string|ICompositeExpression|null $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function leftJoin($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Creates and adds a right join to the query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
+ *
+ *
+ * @param string $fromAlias The alias that points to a from clause.
+ * @param string $join The table name to join.
+ * @param string $alias The alias of the join table.
+ * @param string|ICompositeExpression|null $condition The condition for the join.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function rightJoin($fromAlias, $join, $alias, $condition = null)
+ {
+ }
+
+ /**
+ * Sets a new value for a column in a bulk update query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->update('users', 'u')
+ * ->set('u.password', md5('password'))
+ * ->where('u.id = ?');
+ *
+ *
+ * @param string $key The column to set.
+ * @param ILiteral|IParameter|IQueryFunction|string $value The value, expression, placeholder, etc.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function set($key, $value)
+ {
+ }
+
+ /**
+ * Specifies one or more restrictions to the query result.
+ * Replaces any previously specified restrictions, if any.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->where('u.id = ?');
+ *
+ * // You can optionally programmatically build and/or expressions
+ * $qb = $conn->getQueryBuilder();
+ *
+ * $or = $qb->expr()->orx(
+ * $qb->expr()->eq('u.id', 1),
+ * $qb->expr()->eq('u.id', 2),
+ * );
+ *
+ * $qb->update('users', 'u')
+ * ->set('u.password', md5('password'))
+ * ->where($or);
+ *
+ *
+ * @param mixed ...$predicates The restriction predicates.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function where(...$predicates)
+ {
+ }
+
+ /**
+ * Adds one or more restrictions to the query results, forming a logical
+ * conjunction with any previously specified restrictions.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u')
+ * ->from('users', 'u')
+ * ->where('u.username LIKE ?')
+ * ->andWhere('u.is_active = 1');
+ *
+ *
+ * @param mixed ...$where The query restrictions.
+ *
+ * @return $this This QueryBuilder instance.
+ *
+ * @see where()
+ */
+ public function andWhere(...$where)
+ {
+ }
+
+ /**
+ * Adds one or more restrictions to the query results, forming a logical
+ * disjunction with any previously specified restrictions.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->where('u.id = 1')
+ * ->orWhere('u.id = 2');
+ *
+ *
+ * @param mixed ...$where The WHERE statement.
+ *
+ * @return $this This QueryBuilder instance.
+ *
+ * @see where()
+ */
+ public function orWhere(...$where)
+ {
+ }
+
+ /**
+ * Specifies a grouping over the results of the query.
+ * Replaces any previously specified groupings, if any.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->groupBy('u.id');
+ *
+ *
+ * @param mixed ...$groupBys The grouping expression.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function groupBy(...$groupBys)
+ {
+ }
+
+ /**
+ * Adds a grouping expression to the query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->select('u.name')
+ * ->from('users', 'u')
+ * ->groupBy('u.lastLogin');
+ * ->addGroupBy('u.createdAt')
+ *
+ *
+ * @param mixed ...$groupBy The grouping expression.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function addGroupBy(...$groupBy)
+ {
+ }
+
+ /**
+ * Sets a value for a column in an insert query.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->insert('users')
+ * ->values(
+ * array(
+ * 'name' => '?'
+ * )
+ * )
+ * ->setValue('password', '?');
+ *
+ *
+ * @param string $column The column into which the value should be inserted.
+ * @param IParameter|string $value The value that should be inserted into the column.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function setValue($column, $value)
+ {
+ }
+
+ /**
+ * Specifies values for an insert query indexed by column names.
+ * Replaces any previous values, if any.
+ *
+ *
+ * $qb = $conn->getQueryBuilder()
+ * ->insert('users')
+ * ->values(
+ * array(
+ * 'name' => '?',
+ * 'password' => '?'
+ * )
+ * );
+ *
+ *
+ * @param array $values The values to specify for the insert query indexed by column names.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function values(array $values)
+ {
+ }
+
+ /**
+ * Specifies a restriction over the groups of the query.
+ * Replaces any previous having restrictions, if any.
+ *
+ * @param mixed ...$having The restriction over the groups.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function having(...$having)
+ {
+ }
+
+ /**
+ * Adds a restriction over the groups of the query, forming a logical
+ * conjunction with any existing having restrictions.
+ *
+ * @param mixed ...$having The restriction to append.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function andHaving(...$having)
+ {
+ }
+
+ /**
+ * Adds a restriction over the groups of the query, forming a logical
+ * disjunction with any existing having restrictions.
+ *
+ * @param mixed ...$having The restriction to add.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function orHaving(...$having)
+ {
+ }
+
+ /**
+ * Specifies an ordering for the query results.
+ * Replaces any previously specified orderings, if any.
+ *
+ * @param string|IQueryFunction|ILiteral|IParameter $sort The ordering expression.
+ * @param string $order The ordering direction.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function orderBy($sort, $order = null)
+ {
+ }
+
+ /**
+ * Adds an ordering to the query results.
+ *
+ * @param string|ILiteral|IParameter|IQueryFunction $sort The ordering expression.
+ * @param string $order The ordering direction.
+ *
+ * @return $this This QueryBuilder instance.
+ */
+ public function addOrderBy($sort, $order = null)
+ {
+ }
+
+ /**
+ * Gets a query part by its name.
+ *
+ * @param string $queryPartName
+ *
+ * @return mixed
+ * @deprecated 30.0.0 This function is going to be removed with the next Doctrine/DBAL update
+ * and we can not fix this in our wrapper. Please track the details you need, outside the object.
+ */
+ public function getQueryPart($queryPartName)
+ {
+ }
+
+ /**
+ * Gets all query parts.
+ *
+ * @return array
+ * @deprecated 30.0.0 This function is going to be removed with the next Doctrine/DBAL update
+ * and we can not fix this in our wrapper. Please track the details you need, outside the object.
+ */
+ public function getQueryParts()
+ {
+ }
+
+ /**
+ * Resets SQL parts.
+ *
+ * @param array|null $queryPartNames
+ *
+ * @return $this This QueryBuilder instance.
+ * @deprecated 30.0.0 This function is going to be removed with the next Doctrine/DBAL update
+ * and we can not fix this in our wrapper. Please create a new IQueryBuilder instead.
+ */
+ public function resetQueryParts($queryPartNames = null)
+ {
+ }
+
+ /**
+ * Resets a single SQL part.
+ *
+ * @param string $queryPartName
+ *
+ * @return $this This QueryBuilder instance.
+ * @deprecated 30.0.0 This function is going to be removed with the next Doctrine/DBAL update
+ * and we can not fix this in our wrapper. Please create a new IQueryBuilder instead.
+ */
+ public function resetQueryPart($queryPartName)
+ {
+ }
+
+ /**
+ * Creates a new named parameter and bind the value $value to it.
+ *
+ * This method provides a shortcut for PDOStatement::bindValue
+ * when using prepared statements.
+ *
+ * The parameter $value specifies the value that you want to bind. If
+ * $placeholder is not provided bindValue() will automatically create a
+ * placeholder for you. An automatic placeholder will be of the name
+ * ':dcValue1', ':dcValue2' etc.
+ *
+ * For more information see {@link https://www.php.net/pdostatement-bindparam}
+ *
+ * Example:
+ *
+ * $value = 2;
+ * $q->eq( 'id', $q->bindValue( $value ) );
+ * $stmt = $q->executeQuery(); // executed with 'id = 2'
+ *
+ *
+ * @license New BSD License
+ * @link http://www.zetacomponents.org
+ *
+ * @param mixed $value
+ * @param IQueryBuilder::PARAM_* $type
+ * @param string $placeHolder The name to bind with. The string must start with a colon ':'.
+ *
+ * @return IParameter the placeholder name used.
+ */
+ public function createNamedParameter($value, $type = IQueryBuilder::PARAM_STR, $placeHolder = null)
+ {
+ }
+
+ /**
+ * Creates a new positional parameter and bind the given value to it.
+ *
+ * Attention: If you are using positional parameters with the query builder you have
+ * to be very careful to bind all parameters in the order they appear in the SQL
+ * statement , otherwise they get bound in the wrong order which can lead to serious
+ * bugs in your code.
+ *
+ * Example:
+ *
+ * $qb = $conn->getQueryBuilder();
+ * $qb->select('u.*')
+ * ->from('users', 'u')
+ * ->where('u.username = ' . $qb->createPositionalParameter('Foo', IQueryBuilder::PARAM_STR))
+ * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', IQueryBuilder::PARAM_STR))
+ *
+ *
+ * @param mixed $value
+ * @param IQueryBuilder::PARAM_* $type
+ *
+ * @return IParameter
+ */
+ public function createPositionalParameter($value, $type = IQueryBuilder::PARAM_STR)
+ {
+ }
+
+ /**
+ * Creates a new parameter
+ *
+ * Example:
+ *
+ * $qb = $conn->getQueryBuilder();
+ * $qb->select('u.*')
+ * ->from('users', 'u')
+ * ->where('u.username = ' . $qb->createParameter('name'))
+ * ->setParameter('name', 'Bar', IQueryBuilder::PARAM_STR))
+ *
+ *
+ * @param string $name
+ *
+ * @return IParameter
+ */
+ public function createParameter($name)
+ {
+ }
+
+ /**
+ * Creates a new function
+ *
+ * Attention: Column names inside the call have to be quoted before hand
+ *
+ * Example:
+ *
+ * $qb = $conn->getQueryBuilder();
+ * $qb->select($qb->createFunction('COUNT(*)'))
+ * ->from('users', 'u')
+ * echo $qb->getSQL(); // SELECT COUNT(*) FROM `users` u
+ *
+ *
+ * $qb = $conn->getQueryBuilder();
+ * $qb->select($qb->createFunction('COUNT(`column`)'))
+ * ->from('users', 'u')
+ * echo $qb->getSQL(); // SELECT COUNT(`column`) FROM `users` u
+ *
+ *
+ * @param string $call
+ *
+ * @return IQueryFunction
+ */
+ public function createFunction($call)
+ {
+ }
+
+ /**
+ * Used to get the id of the last inserted element
+ * @return int
+ * @throws \BadMethodCallException When being called before an insert query has been run.
+ */
+ public function getLastInsertId(): int
+ {
+ }
+
+ /**
+ * Returns the table name quoted and with database prefix as needed by the implementation
+ *
+ * @param string|IQueryFunction $table
+ * @return string
+ */
+ public function getTableName($table)
+ {
+ }
+
+ /**
+ * Returns the table name with database prefix as needed by the implementation
+ *
+ * @param string $table
+ * @return string
+ */
+ public function prefixTableName(string $table): string
+ {
+ }
+
+ /**
+ * Returns the column name quoted and with table alias prefix as needed by the implementation
+ *
+ * @param string $column
+ * @param string $tableAlias
+ * @return string
+ */
+ public function getColumnName($column, $tableAlias = '')
+ {
+ }
+
+ /**
+ * Returns the column name quoted and with table alias prefix as needed by the implementation
+ *
+ * @param string $alias
+ * @return string
+ */
+ public function quoteAlias($alias)
+ {
+ }
+
+ public function escapeLikeParameter(string $parameter): string
+ {
+ }
+
+ public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self
+ {
+ }
+
+ public function runAcrossAllShards(): self
+ {
+ }
+
+}
diff --git a/tests/stubs/oc_db_schemawrapper.php b/tests/stubs/oc_db_schemawrapper.php
new file mode 100644
index 000000000..d69e775ca
--- /dev/null
+++ b/tests/stubs/oc_db_schemawrapper.php
@@ -0,0 +1,113 @@
+ $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged
+ */
+ public function update($id, array $data)
+ {
+ }
+
+ /**
+ * extract query parts and params array from data array
+ *
+ * @param array $data
+ * @return array
+ */
+ protected function normalizeData(array $data): array
+ {
+ }
+
+ /**
+ * get the file id for a file
+ *
+ * A file id is a numeric id for a file or folder that's unique within an owncloud instance which stays the same for the lifetime of a file
+ *
+ * File ids are easiest way for apps to store references to a file since unlike paths they are not affected by renames or sharing
+ *
+ * @param string $file
+ * @return int
+ */
+ public function getId($file)
+ {
+ }
+
+ /**
+ * get the id of the parent folder of a file
+ *
+ * @param string $file
+ * @return int
+ */
+ public function getParentId($file)
+ {
+ }
+
+ /**
+ * check if a file is available in the cache
+ *
+ * @param string $file
+ * @return bool
+ */
+ public function inCache($file)
+ {
+ }
+
+ /**
+ * remove a file or folder from the cache
+ *
+ * when removing a folder from the cache all files and folders inside the folder will be removed as well
+ *
+ * @param string $file
+ */
+ public function remove($file)
+ {
+ }
+
+ /**
+ * Move a file or folder in the cache
+ *
+ * @param string $source
+ * @param string $target
+ */
+ public function move($source, $target)
+ {
+ }
+
+ /**
+ * Get the storage id and path needed for a move
+ *
+ * @param string $path
+ * @return array [$storageId, $internalPath]
+ */
+ protected function getMoveInfo($path)
+ {
+ }
+
+ protected function hasEncryptionWrapper(): bool
+ {
+ }
+
+ /**
+ * Move a file or folder in the cache
+ *
+ * @param ICache $sourceCache
+ * @param string $sourcePath
+ * @param string $targetPath
+ * @throws \OC\DatabaseException
+ * @throws \Exception if the given storages have an invalid id
+ */
+ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath)
+ {
+ }
+
+ /**
+ * remove all entries for files that are stored on the storage from the cache
+ */
+ public function clear()
+ {
+ }
+
+ /**
+ * Get the scan status of a file
+ *
+ * - Cache::NOT_FOUND: File is not in the cache
+ * - Cache::PARTIAL: File is not stored in the cache but some incomplete data is known
+ * - Cache::SHALLOW: The folder and it's direct children are in the cache but not all sub folders are fully scanned
+ * - Cache::COMPLETE: The file or folder, with all it's children) are fully scanned
+ *
+ * @param string $file
+ *
+ * @return int Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
+ */
+ public function getStatus($file)
+ {
+ }
+
+ /**
+ * search for files matching $pattern
+ *
+ * @param string $pattern the search pattern using SQL search syntax (e.g. '%searchstring%')
+ * @return ICacheEntry[] an array of cache entries where the name matches the search pattern
+ */
+ public function search($pattern)
+ {
+ }
+
+ /**
+ * search for files by mimetype
+ *
+ * @param string $mimetype either a full mimetype to search ('text/plain') or only the first part of a mimetype ('image')
+ * where it will search for all mimetypes in the group ('image/*')
+ * @return ICacheEntry[] an array of cache entries where the mimetype matches the search
+ */
+ public function searchByMime($mimetype)
+ {
+ }
+
+ public function searchQuery(ISearchQuery $query)
+ {
+ }
+
+ /**
+ * Re-calculate the folder size and the size of all parent folders
+ *
+ * @param array|ICacheEntry|null $data (optional) meta data of the folder
+ */
+ public function correctFolderSize(string $path, $data = null, bool $isBackgroundScan = false): void
+ {
+ }
+
+ /**
+ * get the incomplete count that shares parent $folder
+ *
+ * @param int $fileId the file id of the folder
+ * @return int
+ */
+ public function getIncompleteChildrenCount($fileId)
+ {
+ }
+
+ /**
+ * calculate the size of a folder and set it in the cache
+ *
+ * @param string $path
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
+ * @return int|float
+ */
+ public function calculateFolderSize($path, $entry = null)
+ {
+ }
+
+
+ /**
+ * inner function because we can't add new params to the public function without breaking any child classes
+ *
+ * @param string $path
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
+ * @param bool $ignoreUnknown don't mark the folder size as unknown if any of it's children are unknown
+ * @return int|float
+ */
+ protected function calculateFolderSizeInner(string $path, $entry = null, bool $ignoreUnknown = false)
+ {
+ }
+
+ /**
+ * get all file ids on the files on the storage
+ *
+ * @return int[]
+ */
+ public function getAll()
+ {
+ }
+
+ /**
+ * find a folder in the cache which has not been fully scanned
+ *
+ * If multiple incomplete folders are in the cache, the one with the highest id will be returned,
+ * use the one with the highest id gives the best result with the background scanner, since that is most
+ * likely the folder where we stopped scanning previously
+ *
+ * @return string|false the path of the folder or false when no folder matched
+ */
+ public function getIncomplete()
+ {
+ }
+
+ /**
+ * get the path of a file on this storage by it's file id
+ *
+ * @param int $id the file id of the file or folder to search
+ * @return string|null the path of the file (relative to the storage) or null if a file with the given id does not exists within this cache
+ */
+ public function getPathById($id)
+ {
+ }
+
+ /**
+ * get the storage id of the storage for a file and the internal path of the file
+ * unlike getPathById this does not limit the search to files on this storage and
+ * instead does a global search in the cache table
+ *
+ * @param int $id
+ * @return array first element holding the storage id, second the path
+ * @deprecated 17.0.0 use getPathById() instead
+ */
+ public static function getById($id)
+ {
+ }
+
+ /**
+ * normalize the given path
+ *
+ * @param string $path
+ * @return string
+ */
+ public function normalize($path)
+ {
+ }
+
+ /**
+ * Copy a file or folder in the cache
+ *
+ * @param ICache $sourceCache
+ * @param ICacheEntry $sourceEntry
+ * @param string $targetPath
+ * @return int fileId of copied entry
+ */
+ public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int
+ {
+ }
+
+ public function getQueryFilterForStorage(): ISearchOperator
+ {
+ }
+
+ public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry
+ {
+ }
+}
diff --git a/tests/stubs/oc_files_cache_cacheentry.php b/tests/stubs/oc_files_cache_cacheentry.php
new file mode 100644
index 000000000..a4351d98e
--- /dev/null
+++ b/tests/stubs/oc_files_cache_cacheentry.php
@@ -0,0 +1,115 @@
+ $gids List of groupIds for which we want to create a IGroup object
+ * @param array $displayNames Array containing already know display name for a groupId
+ * @return array
+ */
+ protected function getGroupsObjects(array $gids, array $displayNames = []): array
+ {
+ }
+
+ /**
+ * @param string $gid
+ * @return bool
+ */
+ public function groupExists($gid)
+ {
+ }
+
+ /**
+ * @param string $gid
+ * @return IGroup|null
+ */
+ public function createGroup($gid)
+ {
+ }
+
+ /**
+ * @param string $search
+ * @param ?int $limit
+ * @param ?int $offset
+ * @return \OC\Group\Group[]
+ */
+ public function search(string $search, ?int $limit = null, ?int $offset = 0)
+ {
+ }
+
+ /**
+ * @param IUser|null $user
+ * @return \OC\Group\Group[]
+ */
+ public function getUserGroups(?IUser $user = null)
+ {
+ }
+
+ /**
+ * @param string $uid the user id
+ * @return \OC\Group\Group[]
+ */
+ public function getUserIdGroups(string $uid): array
+ {
+ }
+
+ /**
+ * Checks if a userId is in the admin group
+ *
+ * @param string $userId
+ * @return bool if admin
+ */
+ public function isAdmin($userId)
+ {
+ }
+
+ public function isDelegatedAdmin(string $userId): bool
+ {
+ }
+
+ /**
+ * Checks if a userId is in a group
+ *
+ * @param string $userId
+ * @param string $group
+ * @return bool if in group
+ */
+ public function isInGroup($userId, $group)
+ {
+ }
+
+ /**
+ * get a list of group ids for a user
+ *
+ * @param IUser $user
+ * @return list with group ids
+ */
+ public function getUserGroupIds(IUser $user): array
+ {
+ }
+
+ /**
+ * @param string $groupId
+ * @return ?string
+ */
+ public function getDisplayName(string $groupId): ?string
+ {
+ }
+
+ /**
+ * get an array of groupid and displayName for a user
+ *
+ * @param IUser $user
+ * @return array ['displayName' => displayname]
+ */
+ public function getUserGroupNames(IUser $user)
+ {
+ }
+
+ /**
+ * get a list of all display names in a group
+ *
+ * @param string $gid
+ * @param string $search
+ * @param int $limit
+ * @param int $offset
+ * @return array an array of display names (value) and user ids (key)
+ */
+ public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0)
+ {
+ }
+
+ /**
+ * @return \OC\SubAdmin
+ */
+ public function getSubAdmin()
+ {
+ }
+}
diff --git a/tests/stubs/oc_hooks_basicemitter.php b/tests/stubs/oc_hooks_basicemitter.php
new file mode 100644
index 000000000..c9444b404
--- /dev/null
+++ b/tests/stubs/oc_hooks_basicemitter.php
@@ -0,0 +1,14 @@
+get($app) instead
+ */
+ public function getAppDataDir($app)
+ {
+ }
+
+ /**
+ * @return \OCP\Lockdown\ILockdownManager
+ * @deprecated 20.0.0
+ */
+ public function getLockdownManager()
+ {
+ }
+
+ /**
+ * @return \OCP\Federation\ICloudIdManager
+ * @deprecated 20.0.0
+ */
+ public function getCloudIdManager()
+ {
+ }
+
+ /**
+ * @return \OCP\GlobalScale\IConfig
+ * @deprecated 20.0.0
+ */
+ public function getGlobalScaleConfig()
+ {
+ }
+
+ /**
+ * @return \OCP\Federation\ICloudFederationProviderManager
+ * @deprecated 20.0.0
+ */
+ public function getCloudFederationProviderManager()
+ {
+ }
+
+ /**
+ * @return \OCP\Remote\Api\IApiFactory
+ * @deprecated 20.0.0
+ */
+ public function getRemoteApiFactory()
+ {
+ }
+
+ /**
+ * @return \OCP\Federation\ICloudFederationFactory
+ * @deprecated 20.0.0
+ */
+ public function getCloudFederationFactory()
+ {
+ }
+
+ /**
+ * @return \OCP\Remote\IInstanceFactory
+ * @deprecated 20.0.0
+ */
+ public function getRemoteInstanceFactory()
+ {
+ }
+
+ /**
+ * @return IStorageFactory
+ * @deprecated 20.0.0
+ */
+ public function getStorageFactory()
+ {
+ }
+
+ /**
+ * Get the Preview GeneratorHelper
+ *
+ * @return GeneratorHelper
+ * @since 17.0.0
+ * @deprecated 20.0.0
+ */
+ public function getGeneratorHelper()
+ {
+ }
+}
diff --git a/tests/stubs/oc_servercontainer.php b/tests/stubs/oc_servercontainer.php
new file mode 100644
index 000000000..2c7c3cafb
--- /dev/null
+++ b/tests/stubs/oc_servercontainer.php
@@ -0,0 +1,101 @@
+|string $name
+ * @return T|mixed
+ * @psalm-template S as class-string|string
+ * @psalm-param S $name
+ * @psalm-return (S is class-string ? T : mixed)
+ * @throws QueryException
+ * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
+ */
+ public function query(string $name, bool $autoload = true)
+ {
+ }
+
+ /**
+ * @internal
+ * @param string $id
+ * @return DIContainer|null
+ */
+ public function getAppContainerForService(string $id): ?DIContainer
+ {
+ }
+}
diff --git a/tests/stubs/oc_share20_share.php b/tests/stubs/oc_share20_share.php
new file mode 100644
index 000000000..9334e89ea
--- /dev/null
+++ b/tests/stubs/oc_share20_share.php
@@ -0,0 +1,442 @@
+ true,
+ 'datadirectory' => true,
+ 'dbname' => true,
+ 'dbhost' => true,
+ 'dbpassword' => true,
+ 'dbuser' => true,
+ 'dbreplica' => true,
+ 'activity_dbname' => true,
+ 'activity_dbhost' => true,
+ 'activity_dbpassword' => true,
+ 'activity_dbuser' => true,
+ 'mail_from_address' => true,
+ 'mail_domain' => true,
+ 'mail_smtphost' => true,
+ 'mail_smtpname' => true,
+ 'mail_smtppassword' => true,
+ 'passwordsalt' => true,
+ 'secret' => true,
+ 'updater.secret' => true,
+ 'updater.server.url' => true,
+ 'trusted_proxies' => true,
+ 'preview_imaginary_url' => true,
+ 'preview_imaginary_key' => true,
+ 'proxyuserpwd' => true,
+ 'sentry.dsn' => true,
+ 'sentry.public-dsn' => true,
+ 'zammad.download.secret' => true,
+ 'zammad.portal.secret' => true,
+ 'zammad.secret' => true,
+ 'github.client_id' => true,
+ 'github.client_secret' => true,
+ 'log.condition' => [
+ 'shared_secret' => true,
+ 'matches' => true,
+ ],
+ 'license-key' => true,
+ 'redis' => [
+ 'host' => true,
+ 'password' => true,
+ ],
+ 'redis.cluster' => [
+ 'seeds' => true,
+ 'password' => true,
+ ],
+ 'objectstore' => [
+ 'arguments' => [
+ // Legacy Swift (https://github.com/nextcloud/server/pull/17696#discussion_r341302207)
+ 'options' => [
+ 'credentials' => [
+ 'key' => true,
+ 'secret' => true,
+ ]
+ ],
+ // S3
+ 'key' => true,
+ 'secret' => true,
+ 'sse_c_key' => true,
+ // Swift v2
+ 'username' => true,
+ 'password' => true,
+ // Swift v3
+ 'user' => [
+ 'name' => true,
+ 'password' => true,
+ ],
+ ],
+ ],
+ 'objectstore_multibucket' => [
+ 'arguments' => [
+ 'options' => [
+ 'credentials' => [
+ 'key' => true,
+ 'secret' => true,
+ ]
+ ],
+ // S3
+ 'key' => true,
+ 'secret' => true,
+ // Swift v2
+ 'username' => true,
+ 'password' => true,
+ // Swift v3
+ 'user' => [
+ 'name' => true,
+ 'password' => true,
+ ],
+ ],
+ ],
+ 'onlyoffice' => [
+ 'jwt_secret' => true,
+ ],
+ 'PASS' => true,
+ ];
+
+ public function __construct(
+ private Config $config,
+ ) {
+ }
+
+ /**
+ * Since system config is admin controlled, we can tell psalm to ignore any taint
+ *
+ * @psalm-taint-escape sql
+ * @psalm-taint-escape html
+ * @psalm-taint-escape ldap
+ * @psalm-taint-escape callable
+ * @psalm-taint-escape file
+ * @psalm-taint-escape ssrf
+ * @psalm-taint-escape cookie
+ * @psalm-taint-escape header
+ * @psalm-taint-escape has_quotes
+ * @psalm-pure
+ */
+ public static function trustSystemConfig(mixed $value): mixed
+ {
+ }
+
+ /**
+ * Lists all available config keys
+ * @return array an array of key names
+ */
+ public function getKeys()
+ {
+ }
+
+ /**
+ * Sets a new system wide value
+ *
+ * @param string $key the key of the value, under which will be saved
+ * @param mixed $value the value that should be stored
+ */
+ public function setValue($key, $value)
+ {
+ }
+
+ /**
+ * Sets and deletes values and writes the config.php
+ *
+ * @param array $configs Associative array with `key => value` pairs
+ * If value is null, the config key will be deleted
+ */
+ public function setValues(array $configs)
+ {
+ }
+
+ /**
+ * Looks up a system wide defined value
+ *
+ * @param string $key the key of the value, under which it was saved
+ * @param mixed $default the default value to be returned if the value isn't set
+ * @return mixed the value or $default
+ */
+ public function getValue($key, $default = '')
+ {
+ }
+
+ /**
+ * Looks up a system wide defined value and filters out sensitive data
+ *
+ * @param string $key the key of the value, under which it was saved
+ * @param mixed $default the default value to be returned if the value isn't set
+ * @return mixed the value or $default
+ */
+ public function getFilteredValue($key, $default = '')
+ {
+ }
+
+ /**
+ * Delete a system wide defined value
+ *
+ * @param string $key the key of the value, under which it was saved
+ */
+ public function deleteValue($key)
+ {
+ }
+
+ /**
+ * @param bool|array $keysToRemove
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function removeSensitiveValue($keysToRemove, $value)
+ {
+ }
+}
diff --git a/tests/stubs/oc_user_manager.php b/tests/stubs/oc_user_manager.php
new file mode 100644
index 000000000..0b25efd22
--- /dev/null
+++ b/tests/stubs/oc_user_manager.php
@@ -0,0 +1,333 @@
+ an array of backend class as key and count number as value
+ */
+ public function countUsers()
+ {
+ }
+
+ public function countUsersTotal(int $limit = 0, bool $onlyMappedUsers = false): int|false
+ {
+ }
+
+ /**
+ * returns how many users per backend exist in the requested groups (if supported by backend)
+ *
+ * @param IGroup[] $groups an array of gid to search in
+ * @return array|int an array of backend class as key and count number as value
+ * if $hasLoggedIn is true only an int is returned
+ */
+ public function countUsersOfGroups(array $groups)
+ {
+ }
+
+ /**
+ * The callback is executed for each user on each backend.
+ * If the callback returns false no further users will be retrieved.
+ *
+ * @psalm-param \Closure(\OCP\IUser):?bool $callback
+ * @param string $search
+ * @param boolean $onlySeen when true only users that have a lastLogin entry
+ * in the preferences table will be affected
+ * @since 9.0.0
+ */
+ public function callForAllUsers(\Closure $callback, $search = '', $onlySeen = false)
+ {
+ }
+
+ /**
+ * returns how many users are disabled
+ *
+ * @return int
+ * @since 12.0.0
+ */
+ public function countDisabledUsers(): int
+ {
+ }
+
+ /**
+ * returns how many users are disabled in the requested groups
+ *
+ * @param array $groups groupids to search
+ * @return int
+ * @since 14.0.0
+ */
+ public function countDisabledUsersOfGroups(array $groups): int
+ {
+ }
+
+ /**
+ * returns how many users have logged in once
+ *
+ * @return int
+ * @since 11.0.0
+ */
+ public function countSeenUsers()
+ {
+ }
+
+ /**
+ * @param \Closure $callback
+ * @psalm-param \Closure(\OCP\IUser):?bool $callback
+ * @since 11.0.0
+ */
+ public function callForSeenUsers(\Closure $callback)
+ {
+ }
+
+ /**
+ * @param string $email
+ * @return IUser[]
+ * @since 9.1.0
+ */
+ public function getByEmail($email)
+ {
+ }
+
+ /**
+ * @param string $uid
+ * @param bool $checkDataDirectory
+ * @throws \InvalidArgumentException Message is an already translated string with a reason why the id is not valid
+ * @since 26.0.0
+ */
+ public function validateUserId(string $uid, bool $checkDataDirectory = false): void
+ {
+ }
+
+ /**
+ * Gets the list of user ids sorted by lastLogin, from most recent to least recent
+ *
+ * @param int|null $limit how many users to fetch (default: 25, max: 100)
+ * @param int $offset from which offset to fetch
+ * @param string $search search users based on search params
+ * @return list list of user IDs
+ */
+ public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string $search = ''): array
+ {
+ }
+
+ public function getDisplayNameCache(): DisplayNameCache
+ {
+ }
+}
diff --git a/tests/stubs/oc_user_nouserexception.php b/tests/stubs/oc_user_nouserexception.php
new file mode 100644
index 000000000..c0a5c51b0
--- /dev/null
+++ b/tests/stubs/oc_user_nouserexception.php
@@ -0,0 +1,11 @@
+ list of open server-to-server shares
+ */
+ public function getOpenShares()
+ {
+ }
+
+ /**
+ * return a list of shares which are accepted by the user
+ *
+ * @return list list of accepted server-to-server shares
+ */
+ public function getAcceptedShares()
+ {
+ }
+}
diff --git a/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php b/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php
new file mode 100644
index 000000000..8a4d5c439
--- /dev/null
+++ b/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Attribute\AsCommand;
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
+use Symfony\Component\Console\Completion\Suggestion;
+use Symfony\Component\Console\Exception\ExceptionInterface;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Helper\HelperInterface;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Base class for all commands.
+ *
+ * @author Fabien Potencier
+ */
+class Command
+{
+ // see https://tldp.org/LDP/abs/html/exitcodes.html
+ public const SUCCESS = 0;
+ public const FAILURE = 1;
+ public const INVALID = 2;
+
+ /**
+ * @var string|null The default command name
+ *
+ * @deprecated since Symfony 6.1, use the AsCommand attribute instead
+ */
+ protected static $defaultName;
+
+ /**
+ * @var string|null The default command description
+ *
+ * @deprecated since Symfony 6.1, use the AsCommand attribute instead
+ */
+ protected static $defaultDescription;
+
+ public static function getDefaultName(): ?string
+ {
+ }
+
+ public static function getDefaultDescription(): ?string
+ {
+ }
+
+ /**
+ * @param string|null $name The name of the command; passing null means it must be set in configure()
+ *
+ * @throws LogicException When the command name is empty
+ */
+ public function __construct(?string $name = null)
+ {
+ }
+
+ /**
+ * Ignores validation errors.
+ *
+ * This is mainly useful for the help command.
+ *
+ * @return void
+ */
+ public function ignoreValidationErrors()
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setApplication(?Application $application = null)
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setHelperSet(HelperSet $helperSet)
+ {
+ }
+
+ /**
+ * Gets the helper set.
+ */
+ public function getHelperSet(): ?HelperSet
+ {
+ }
+
+ /**
+ * Gets the application instance for this command.
+ */
+ public function getApplication(): ?Application
+ {
+ }
+
+ /**
+ * Checks whether the command is enabled or not in the current environment.
+ *
+ * Override this to check for x or y and return false if the command cannot
+ * run properly under the current conditions.
+ *
+ * @return bool
+ */
+ public function isEnabled()
+ {
+ }
+
+ /**
+ * Configures the current command.
+ *
+ * @return void
+ */
+ protected function configure()
+ {
+ }
+
+ /**
+ * Executes the current command.
+ *
+ * This method is not abstract because you can use this class
+ * as a concrete class. In this case, instead of defining the
+ * execute() method, you set the code to execute by passing
+ * a Closure to the setCode() method.
+ *
+ * @return int 0 if everything went fine, or an exit code
+ *
+ * @throws LogicException When this abstract method is not implemented
+ *
+ * @see setCode()
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ }
+
+ /**
+ * Interacts with the user.
+ *
+ * This method is executed before the InputDefinition is validated.
+ * This means that this is the only place where the command can
+ * interactively ask for values of missing required arguments.
+ *
+ * @return void
+ */
+ protected function interact(InputInterface $input, OutputInterface $output)
+ {
+ }
+
+ /**
+ * Initializes the command after the input has been bound and before the input
+ * is validated.
+ *
+ * This is mainly useful when a lot of commands extends one main command
+ * where some things need to be initialized based on the input arguments and options.
+ *
+ * @see InputInterface::bind()
+ * @see InputInterface::validate()
+ *
+ * @return void
+ */
+ protected function initialize(InputInterface $input, OutputInterface $output)
+ {
+ }
+
+ /**
+ * Runs the command.
+ *
+ * The code to execute is either defined directly with the
+ * setCode() method or by overriding the execute() method
+ * in a sub-class.
+ *
+ * @return int The command exit code
+ *
+ * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}.
+ *
+ * @see setCode()
+ * @see execute()
+ */
+ public function run(InputInterface $input, OutputInterface $output): int
+ {
+ }
+
+ /**
+ * Adds suggestions to $suggestions for the current completion input (e.g. option or argument).
+ */
+ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
+ {
+ }
+
+ /**
+ * Sets the code to execute when running this command.
+ *
+ * If this method is used, it overrides the code defined
+ * in the execute() method.
+ *
+ * @param callable $code A callable(InputInterface $input, OutputInterface $output)
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException
+ *
+ * @see execute()
+ */
+ public function setCode(callable $code): static
+ {
+ }
+
+ /**
+ * Merges the application definition with the command definition.
+ *
+ * This method is not part of public API and should not be used directly.
+ *
+ * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments
+ *
+ * @internal
+ */
+ public function mergeApplicationDefinition(bool $mergeArgs = true): void
+ {
+ }
+
+ /**
+ * Sets an array of argument and option instances.
+ *
+ * @return $this
+ */
+ public function setDefinition(array|InputDefinition $definition): static
+ {
+ }
+
+ /**
+ * Gets the InputDefinition attached to this Command.
+ */
+ public function getDefinition(): InputDefinition
+ {
+ }
+
+ /**
+ * Gets the InputDefinition to be used to create representations of this Command.
+ *
+ * Can be overridden to provide the original command representation when it would otherwise
+ * be changed by merging with the application InputDefinition.
+ *
+ * This method is not part of public API and should not be used directly.
+ */
+ public function getNativeDefinition(): InputDefinition
+ {
+ }
+
+ /**
+ * Adds an argument.
+ *
+ * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
+ * @param $default The default value (for InputArgument::OPTIONAL mode only)
+ * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException When argument mode is not valid
+ */
+ public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null): static
+ {
+ }
+
+ /**
+ * Adds an option.
+ *
+ * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
+ * @param $mode The option mode: One of the InputOption::VALUE_* constants
+ * @param $default The default value (must be null for InputOption::VALUE_NONE)
+ * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException If option mode is invalid or incompatible
+ */
+ public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null): static
+ {
+ }
+
+ /**
+ * Sets the name of the command.
+ *
+ * This method can set both the namespace and the name if
+ * you separate them by a colon (:)
+ *
+ * $command->setName('foo:bar');
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException When the name is invalid
+ */
+ public function setName(string $name): static
+ {
+ }
+
+ /**
+ * Sets the process title of the command.
+ *
+ * This feature should be used only when creating a long process command,
+ * like a daemon.
+ *
+ * @return $this
+ */
+ public function setProcessTitle(string $title): static
+ {
+ }
+
+ /**
+ * Returns the command name.
+ */
+ public function getName(): ?string
+ {
+ }
+
+ /**
+ * @param bool $hidden Whether or not the command should be hidden from the list of commands
+ *
+ * @return $this
+ */
+ public function setHidden(bool $hidden = true): static
+ {
+ }
+
+ /**
+ * @return bool whether the command should be publicly shown or not
+ */
+ public function isHidden(): bool
+ {
+ }
+
+ /**
+ * Sets the description for the command.
+ *
+ * @return $this
+ */
+ public function setDescription(string $description): static
+ {
+ }
+
+ /**
+ * Returns the description for the command.
+ */
+ public function getDescription(): string
+ {
+ }
+
+ /**
+ * Sets the help for the command.
+ *
+ * @return $this
+ */
+ public function setHelp(string $help): static
+ {
+ }
+
+ /**
+ * Returns the help for the command.
+ */
+ public function getHelp(): string
+ {
+ }
+
+ /**
+ * Returns the processed help for the command replacing the %command.name% and
+ * %command.full_name% patterns with the real values dynamically.
+ */
+ public function getProcessedHelp(): string
+ {
+ }
+
+ /**
+ * Sets the aliases for the command.
+ *
+ * @param string[] $aliases An array of aliases for the command
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException When an alias is invalid
+ */
+ public function setAliases(iterable $aliases): static
+ {
+ }
+
+ /**
+ * Returns the aliases for the command.
+ */
+ public function getAliases(): array
+ {
+ }
+
+ /**
+ * Returns the synopsis for the command.
+ *
+ * @param bool $short Whether to show the short version of the synopsis (with options folded) or not
+ */
+ public function getSynopsis(bool $short = false): string
+ {
+ }
+
+ /**
+ * Add a command usage example, it'll be prefixed with the command name.
+ *
+ * @return $this
+ */
+ public function addUsage(string $usage): static
+ {
+ }
+
+ /**
+ * Returns alternative usages of the command.
+ */
+ public function getUsages(): array
+ {
+ }
+
+ /**
+ * Gets a helper instance by name.
+ *
+ * @return HelperInterface
+ *
+ * @throws LogicException if no HelperSet is defined
+ * @throws InvalidArgumentException if the helper is not defined
+ */
+ public function getHelper(string $name): mixed
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_helper_helper.php b/tests/stubs/symfony_component_console_helper_helper.php
new file mode 100644
index 000000000..9ae9afa84
--- /dev/null
+++ b/tests/stubs/symfony_component_console_helper_helper.php
@@ -0,0 +1,80 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+use Symfony\Component\String\UnicodeString;
+
+/**
+ * Helper is the base class for all helper classes.
+ *
+ * @author Fabien Potencier
+ */
+abstract class Helper implements HelperInterface
+{
+ protected $helperSet;
+
+ /**
+ * @return void
+ */
+ public function setHelperSet(?HelperSet $helperSet = null)
+ {
+ }
+
+ public function getHelperSet(): ?HelperSet
+ {
+ }
+
+ /**
+ * Returns the width of a string, using mb_strwidth if it is available.
+ * The width is how many characters positions the string will use.
+ */
+ public static function width(?string $string): int
+ {
+ }
+
+ /**
+ * Returns the length of a string, using mb_strlen if it is available.
+ * The length is related to how many bytes the string will use.
+ */
+ public static function length(?string $string): int
+ {
+ }
+
+ /**
+ * Returns the subset of a string, using mb_substr if it is available.
+ */
+ public static function substr(?string $string, int $from, ?int $length = null): string
+ {
+ }
+
+ /**
+ * @return string
+ */
+ public static function formatTime(int|float $secs, int $precision = 1)
+ {
+ }
+
+ /**
+ * @return string
+ */
+ public static function formatMemory(int $memory)
+ {
+ }
+
+ /**
+ * @return string
+ */
+ public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string)
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_helper_helperinterface.php b/tests/stubs/symfony_component_console_helper_helperinterface.php
new file mode 100644
index 000000000..9e58682da
--- /dev/null
+++ b/tests/stubs/symfony_component_console_helper_helperinterface.php
@@ -0,0 +1,45 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+/**
+ * HelperInterface is the interface all helpers must implement.
+ *
+ * @author Fabien Potencier
+ */
+interface HelperInterface
+{
+ /**
+ * Sets the helper set associated with this helper.
+ *
+ * @return void
+ */
+ public function setHelperSet(?HelperSet $helperSet)
+ {
+ }
+
+ /**
+ * Gets the helper set associated with this helper.
+ */
+ public function getHelperSet(): ?HelperSet
+ {
+ }
+
+ /**
+ * Returns the canonical name of this helper.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_helper_questionhelper.php b/tests/stubs/symfony_component_console_helper_questionhelper.php
new file mode 100644
index 000000000..8dd76875e
--- /dev/null
+++ b/tests/stubs/symfony_component_console_helper_questionhelper.php
@@ -0,0 +1,85 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Cursor;
+use Symfony\Component\Console\Exception\MissingInputException;
+use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\StreamableInputInterface;
+use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Output\ConsoleSectionOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\ChoiceQuestion;
+use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Terminal;
+
+use function Symfony\Component\String\s;
+
+/**
+ * The QuestionHelper class provides helpers to interact with the user.
+ *
+ * @author Fabien Potencier
+ */
+class QuestionHelper extends Helper
+{
+ /**
+ * Asks a question to the user.
+ *
+ * @return mixed The user answer
+ *
+ * @throws RuntimeException If there is no data to read in the input stream
+ */
+ public function ask(InputInterface $input, OutputInterface $output, Question $question): mixed
+ {
+ }
+
+ public function getName(): string
+ {
+ }
+
+ /**
+ * Prevents usage of stty.
+ *
+ * @return void
+ */
+ public static function disableStty()
+ {
+ }
+
+ /**
+ * Outputs the question prompt.
+ *
+ * @return void
+ */
+ protected function writePrompt(OutputInterface $output, Question $question)
+ {
+ }
+
+ /**
+ * @return string[]
+ */
+ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag): array
+ {
+ }
+
+ /**
+ * Outputs an error message.
+ *
+ * @return void
+ */
+ protected function writeError(OutputInterface $output, \Exception $error)
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_helper_table.php b/tests/stubs/symfony_component_console_helper_table.php
new file mode 100644
index 000000000..373b3ffff
--- /dev/null
+++ b/tests/stubs/symfony_component_console_helper_table.php
@@ -0,0 +1,218 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface;
+use Symfony\Component\Console\Output\ConsoleSectionOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Provides helpers to display a table.
+ *
+ * @author Fabien Potencier
+ * @author Саша Стаменковић
+ * @author Abdellatif Ait boudad
+ * @author Max Grigorian
+ * @author Dany Maillard
+ */
+class Table
+{
+ private const SEPARATOR_TOP = 0;
+ private const SEPARATOR_TOP_BOTTOM = 1;
+ private const SEPARATOR_MID = 2;
+ private const SEPARATOR_BOTTOM = 3;
+ private const BORDER_OUTSIDE = 0;
+ private const BORDER_INSIDE = 1;
+ private const DISPLAY_ORIENTATION_DEFAULT = 'default';
+ private const DISPLAY_ORIENTATION_HORIZONTAL = 'horizontal';
+ private const DISPLAY_ORIENTATION_VERTICAL = 'vertical';
+
+ public function __construct(OutputInterface $output)
+ {
+ }
+
+ /**
+ * Sets a style definition.
+ *
+ * @return void
+ */
+ public static function setStyleDefinition(string $name, TableStyle $style)
+ {
+ }
+
+ /**
+ * Gets a style definition by name.
+ */
+ public static function getStyleDefinition(string $name): TableStyle
+ {
+ }
+
+ /**
+ * Sets table style.
+ *
+ * @return $this
+ */
+ public function setStyle(TableStyle|string $name): static
+ {
+ }
+
+ /**
+ * Gets the current table style.
+ */
+ public function getStyle(): TableStyle
+ {
+ }
+
+ /**
+ * Sets table column style.
+ *
+ * @param TableStyle|string $name The style name or a TableStyle instance
+ *
+ * @return $this
+ */
+ public function setColumnStyle(int $columnIndex, TableStyle|string $name): static
+ {
+ }
+
+ /**
+ * Gets the current style for a column.
+ *
+ * If style was not set, it returns the global table style.
+ */
+ public function getColumnStyle(int $columnIndex): TableStyle
+ {
+ }
+
+ /**
+ * Sets the minimum width of a column.
+ *
+ * @return $this
+ */
+ public function setColumnWidth(int $columnIndex, int $width): static
+ {
+ }
+
+ /**
+ * Sets the minimum width of all columns.
+ *
+ * @return $this
+ */
+ public function setColumnWidths(array $widths): static
+ {
+ }
+
+ /**
+ * Sets the maximum width of a column.
+ *
+ * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while
+ * formatted strings are preserved.
+ *
+ * @return $this
+ */
+ public function setColumnMaxWidth(int $columnIndex, int $width): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setHeaders(array $headers): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setRows(array $rows)
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function addRows(array $rows): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function addRow(TableSeparator|array $row): static
+ {
+ }
+
+ /**
+ * Adds a row to the table, and re-renders the table.
+ *
+ * @return $this
+ */
+ public function appendRow(TableSeparator|array $row): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setRow(int|string $column, array $row): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setHeaderTitle(?string $title): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setFooterTitle(?string $title): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setHorizontal(bool $horizontal = true): static
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setVertical(bool $vertical = true): static
+ {
+ }
+
+ /**
+ * Renders table to output.
+ *
+ * Example:
+ *
+ * +---------------+-----------------------+------------------+
+ * | ISBN | Title | Author |
+ * +---------------+-----------------------+------------------+
+ * | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
+ * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
+ * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
+ * +---------------+-----------------------+------------------+
+ *
+ * @return void
+ */
+ public function render()
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_input_inputargument.php b/tests/stubs/symfony_component_console_input_inputargument.php
new file mode 100644
index 000000000..8a106813a
--- /dev/null
+++ b/tests/stubs/symfony_component_console_input_inputargument.php
@@ -0,0 +1,107 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
+use Symfony\Component\Console\Completion\Suggestion;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\LogicException;
+
+/**
+ * Represents a command line argument.
+ *
+ * @author Fabien Potencier
+ */
+class InputArgument
+{
+ public const REQUIRED = 1;
+ public const OPTIONAL = 2;
+ public const IS_ARRAY = 4;
+
+ /**
+ * @param string $name The argument name
+ * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY
+ * @param string $description A description text
+ * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only)
+ * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion
+ *
+ * @throws InvalidArgumentException When argument mode is not valid
+ */
+ public function __construct(string $name, ?int $mode = null, string $description = '', string|bool|int|float|array|null $default = null, \Closure|array $suggestedValues = [])
+ {
+ }
+
+ /**
+ * Returns the argument name.
+ */
+ public function getName(): string
+ {
+ }
+
+ /**
+ * Returns true if the argument is required.
+ *
+ * @return bool true if parameter mode is self::REQUIRED, false otherwise
+ */
+ public function isRequired(): bool
+ {
+ }
+
+ /**
+ * Returns true if the argument can take multiple values.
+ *
+ * @return bool true if mode is self::IS_ARRAY, false otherwise
+ */
+ public function isArray(): bool
+ {
+ }
+
+ /**
+ * Sets the default value.
+ *
+ * @return void
+ *
+ * @throws LogicException When incorrect default value is given
+ */
+ public function setDefault(string|bool|int|float|array|null $default = null)
+ {
+ }
+
+ /**
+ * Returns the default value.
+ */
+ public function getDefault(): string|bool|int|float|array|null
+ {
+ }
+
+ public function hasCompletion(): bool
+ {
+ }
+
+ /**
+ * Adds suggestions to $suggestions for the current completion input.
+ *
+ * @see Command::complete()
+ */
+ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
+ {
+ }
+
+ /**
+ * Returns the description text.
+ */
+ public function getDescription(): string
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_input_inputinterface.php b/tests/stubs/symfony_component_console_input_inputinterface.php
new file mode 100644
index 000000000..352937c62
--- /dev/null
+++ b/tests/stubs/symfony_component_console_input_inputinterface.php
@@ -0,0 +1,180 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\RuntimeException;
+
+/**
+ * InputInterface is the interface implemented by all input classes.
+ *
+ * @author Fabien Potencier
+ *
+ * @method string __toString() Returns a stringified representation of the args passed to the command.
+ * InputArguments MUST be escaped as well as the InputOption values passed to the command.
+ */
+interface InputInterface
+{
+ /**
+ * Returns the first argument from the raw parameters (not parsed).
+ */
+ public function getFirstArgument(): ?string
+ {
+ }
+
+ /**
+ * Returns true if the raw parameters (not parsed) contain a value.
+ *
+ * This method is to be used to introspect the input parameters
+ * before they have been validated. It must be used carefully.
+ * Does not necessarily return the correct result for short options
+ * when multiple flags are combined in the same option.
+ *
+ * @param string|array $values The values to look for in the raw parameters (can be an array)
+ * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
+ */
+ public function hasParameterOption(string|array $values, bool $onlyParams = false): bool
+ {
+ }
+
+ /**
+ * Returns the value of a raw option (not parsed).
+ *
+ * This method is to be used to introspect the input parameters
+ * before they have been validated. It must be used carefully.
+ * Does not necessarily return the correct result for short options
+ * when multiple flags are combined in the same option.
+ *
+ * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
+ * @param string|bool|int|float|array|null $default The default value to return if no result is found
+ * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
+ *
+ * @return mixed
+ */
+ public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false)
+ {
+ }
+
+ /**
+ * Binds the current Input instance with the given arguments and options.
+ *
+ * @return void
+ *
+ * @throws RuntimeException
+ */
+ public function bind(InputDefinition $definition)
+ {
+ }
+
+ /**
+ * Validates the input.
+ *
+ * @return void
+ *
+ * @throws RuntimeException When not enough arguments are given
+ */
+ public function validate()
+ {
+ }
+
+ /**
+ * Returns all the given arguments merged with the default values.
+ *
+ * @return array
+ */
+ public function getArguments(): array
+ {
+ }
+
+ /**
+ * Returns the argument value for a given argument name.
+ *
+ * @return mixed
+ *
+ * @throws InvalidArgumentException When argument given doesn't exist
+ */
+ public function getArgument(string $name)
+ {
+ }
+
+ /**
+ * Sets an argument value by name.
+ *
+ * @return void
+ *
+ * @throws InvalidArgumentException When argument given doesn't exist
+ */
+ public function setArgument(string $name, mixed $value)
+ {
+ }
+
+ /**
+ * Returns true if an InputArgument object exists by name or position.
+ */
+ public function hasArgument(string $name): bool
+ {
+ }
+
+ /**
+ * Returns all the given options merged with the default values.
+ *
+ * @return array
+ */
+ public function getOptions(): array
+ {
+ }
+
+ /**
+ * Returns the option value for a given option name.
+ *
+ * @return mixed
+ *
+ * @throws InvalidArgumentException When option given doesn't exist
+ */
+ public function getOption(string $name)
+ {
+ }
+
+ /**
+ * Sets an option value by name.
+ *
+ * @return void
+ *
+ * @throws InvalidArgumentException When option given doesn't exist
+ */
+ public function setOption(string $name, mixed $value)
+ {
+ }
+
+ /**
+ * Returns true if an InputOption object exists by name.
+ */
+ public function hasOption(string $name): bool
+ {
+ }
+
+ /**
+ * Is this input means interactive?
+ */
+ public function isInteractive(): bool
+ {
+ }
+
+ /**
+ * Sets the input interactivity.
+ *
+ * @return void
+ */
+ public function setInteractive(bool $interactive)
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_input_inputoption.php b/tests/stubs/symfony_component_console_input_inputoption.php
new file mode 100644
index 000000000..ab5680e57
--- /dev/null
+++ b/tests/stubs/symfony_component_console_input_inputoption.php
@@ -0,0 +1,159 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Completion\CompletionInput;
+use Symfony\Component\Console\Completion\CompletionSuggestions;
+use Symfony\Component\Console\Completion\Suggestion;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\LogicException;
+
+/**
+ * Represents a command line option.
+ *
+ * @author Fabien Potencier
+ */
+class InputOption
+{
+ /**
+ * Do not accept input for the option (e.g. --yell). This is the default behavior of options.
+ */
+ public const VALUE_NONE = 1;
+
+ /**
+ * A value must be passed when the option is used (e.g. --iterations=5 or -i5).
+ */
+ public const VALUE_REQUIRED = 2;
+
+ /**
+ * The option may or may not have a value (e.g. --yell or --yell=loud).
+ */
+ public const VALUE_OPTIONAL = 4;
+
+ /**
+ * The option accepts multiple values (e.g. --dir=/foo --dir=/bar).
+ */
+ public const VALUE_IS_ARRAY = 8;
+
+ /**
+ * The option may have either positive or negative value (e.g. --ansi or --no-ansi).
+ */
+ public const VALUE_NEGATABLE = 16;
+
+ /**
+ * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
+ * @param int|null $mode The option mode: One of the VALUE_* constants
+ * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE)
+ * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion
+ *
+ * @throws InvalidArgumentException If option mode is invalid or incompatible
+ */
+ public function __construct(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', string|bool|int|float|array|null $default = null, array|\Closure $suggestedValues = [])
+ {
+ }
+
+ /**
+ * Returns the option shortcut.
+ */
+ public function getShortcut(): ?string
+ {
+ }
+
+ /**
+ * Returns the option name.
+ */
+ public function getName(): string
+ {
+ }
+
+ /**
+ * Returns true if the option accepts a value.
+ *
+ * @return bool true if value mode is not self::VALUE_NONE, false otherwise
+ */
+ public function acceptValue(): bool
+ {
+ }
+
+ /**
+ * Returns true if the option requires a value.
+ *
+ * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise
+ */
+ public function isValueRequired(): bool
+ {
+ }
+
+ /**
+ * Returns true if the option takes an optional value.
+ *
+ * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise
+ */
+ public function isValueOptional(): bool
+ {
+ }
+
+ /**
+ * Returns true if the option can take multiple values.
+ *
+ * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise
+ */
+ public function isArray(): bool
+ {
+ }
+
+ public function isNegatable(): bool
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setDefault(string|bool|int|float|array|null $default = null)
+ {
+ }
+
+ /**
+ * Returns the default value.
+ */
+ public function getDefault(): string|bool|int|float|array|null
+ {
+ }
+
+ /**
+ * Returns the description text.
+ */
+ public function getDescription(): string
+ {
+ }
+
+ public function hasCompletion(): bool
+ {
+ }
+
+ /**
+ * Adds suggestions to $suggestions for the current completion input.
+ *
+ * @see Command::complete()
+ */
+ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
+ {
+ }
+
+ /**
+ * Checks whether the given option equals this one.
+ */
+ public function equals(self $option): bool
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_output_consoleoutput.php b/tests/stubs/symfony_component_console_output_consoleoutput.php
new file mode 100644
index 000000000..6a01816e3
--- /dev/null
+++ b/tests/stubs/symfony_component_console_output_consoleoutput.php
@@ -0,0 +1,95 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR.
+ *
+ * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR.
+ *
+ * $output = new ConsoleOutput();
+ *
+ * This is equivalent to:
+ *
+ * $output = new StreamOutput(fopen('php://stdout', 'w'));
+ * $stdErr = new StreamOutput(fopen('php://stderr', 'w'));
+ *
+ * @author Fabien Potencier
+ */
+class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
+{
+ /**
+ * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
+ * @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
+ * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
+ */
+ public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null)
+ {
+ }
+
+ /**
+ * Creates a new output section.
+ */
+ public function section(): ConsoleSectionOutput
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setDecorated(bool $decorated)
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setFormatter(OutputFormatterInterface $formatter)
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setVerbosity(int $level)
+ {
+ }
+
+ public function getErrorOutput(): OutputInterface
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setErrorOutput(OutputInterface $error)
+ {
+ }
+
+ /**
+ * Returns true if current environment supports writing console output to
+ * STDOUT.
+ */
+ protected function hasStdoutSupport(): bool
+ {
+ }
+
+ /**
+ * Returns true if current environment supports writing console output to
+ * STDERR.
+ */
+ protected function hasStderrSupport(): bool
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_output_consoleoutputinterface.php b/tests/stubs/symfony_component_console_output_consoleoutputinterface.php
new file mode 100644
index 000000000..79062020c
--- /dev/null
+++ b/tests/stubs/symfony_component_console_output_consoleoutputinterface.php
@@ -0,0 +1,39 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+/**
+ * ConsoleOutputInterface is the interface implemented by ConsoleOutput class.
+ * This adds information about stderr and section output stream.
+ *
+ * @author Dariusz Górecki
+ */
+interface ConsoleOutputInterface extends OutputInterface
+{
+ /**
+ * Gets the OutputInterface for errors.
+ */
+ public function getErrorOutput(): OutputInterface
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setErrorOutput(OutputInterface $error)
+ {
+ }
+
+ public function section(): ConsoleSectionOutput
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_output_consolesectionoutput.php b/tests/stubs/symfony_component_console_output_consolesectionoutput.php
new file mode 100644
index 000000000..a5c231792
--- /dev/null
+++ b/tests/stubs/symfony_component_console_output_consolesectionoutput.php
@@ -0,0 +1,90 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+use Symfony\Component\Console\Helper\Helper;
+use Symfony\Component\Console\Terminal;
+
+/**
+ * @author Pierre du Plessis
+ * @author Gabriel Ostrolucký
+ */
+class ConsoleSectionOutput extends StreamOutput
+{
+ /**
+ * @param resource $stream
+ * @param ConsoleSectionOutput[] $sections
+ */
+ public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter)
+ {
+ }
+
+ /**
+ * Defines a maximum number of lines for this section.
+ *
+ * When more lines are added, the section will automatically scroll to the
+ * end (i.e. remove the first lines to comply with the max height).
+ */
+ public function setMaxHeight(int $maxHeight): void
+ {
+ }
+
+ /**
+ * Clears previous output for this section.
+ *
+ * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared
+ *
+ * @return void
+ */
+ public function clear(?int $lines = null)
+ {
+ }
+
+ /**
+ * Overwrites the previous output with a new message.
+ *
+ * @return void
+ */
+ public function overwrite(string|iterable $message)
+ {
+ }
+
+ public function getContent(): string
+ {
+ }
+
+ public function getVisibleContent(): string
+ {
+ }
+
+ /**
+ * @internal
+ */
+ public function addContent(string $input, bool $newline = true): int
+ {
+ }
+
+ /**
+ * @internal
+ */
+ public function addNewLineOfInputSubmit(): void
+ {
+ }
+
+ /**
+ * @return void
+ */
+ protected function doWrite(string $message, bool $newline)
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_output_output.php b/tests/stubs/symfony_component_console_output_output.php
new file mode 100644
index 000000000..a555faaf7
--- /dev/null
+++ b/tests/stubs/symfony_component_console_output_output.php
@@ -0,0 +1,112 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * Base class for output classes.
+ *
+ * There are five levels of verbosity:
+ *
+ * * normal: no option passed (normal output)
+ * * verbose: -v (more output)
+ * * very verbose: -vv (highly extended output)
+ * * debug: -vvv (all debug output)
+ * * quiet: -q (no output)
+ *
+ * @author Fabien Potencier
+ */
+abstract class Output implements OutputInterface
+{
+ /**
+ * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
+ * @param bool $decorated Whether to decorate messages
+ * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
+ */
+ public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null)
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setFormatter(OutputFormatterInterface $formatter)
+ {
+ }
+
+ public function getFormatter(): OutputFormatterInterface
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setDecorated(bool $decorated)
+ {
+ }
+
+ public function isDecorated(): bool
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setVerbosity(int $level)
+ {
+ }
+
+ public function getVerbosity(): int
+ {
+ }
+
+ public function isQuiet(): bool
+ {
+ }
+
+ public function isVerbose(): bool
+ {
+ }
+
+ public function isVeryVerbose(): bool
+ {
+ }
+
+ public function isDebug(): bool
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL)
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL)
+ {
+ }
+
+ /**
+ * Writes a message to the output.
+ *
+ * @return void
+ */
+ abstract protected function doWrite(string $message, bool $newline)
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_output_outputinterface.php b/tests/stubs/symfony_component_console_output_outputinterface.php
new file mode 100644
index 000000000..f0b0b2f10
--- /dev/null
+++ b/tests/stubs/symfony_component_console_output_outputinterface.php
@@ -0,0 +1,135 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * OutputInterface is the interface implemented by all Output classes.
+ *
+ * @author Fabien Potencier
+ */
+interface OutputInterface
+{
+ public const VERBOSITY_QUIET = 16;
+ public const VERBOSITY_NORMAL = 32;
+ public const VERBOSITY_VERBOSE = 64;
+ public const VERBOSITY_VERY_VERBOSE = 128;
+ public const VERBOSITY_DEBUG = 256;
+
+ public const OUTPUT_NORMAL = 1;
+ public const OUTPUT_RAW = 2;
+ public const OUTPUT_PLAIN = 4;
+
+ /**
+ * Writes a message to the output.
+ *
+ * @param bool $newline Whether to add a newline
+ * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants),
+ * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
+ *
+ * @return void
+ */
+ public function write(string|iterable $messages, bool $newline = false, int $options = 0)
+ {
+ }
+
+ /**
+ * Writes a message to the output and adds a newline at the end.
+ *
+ * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants),
+ * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
+ *
+ * @return void
+ */
+ public function writeln(string|iterable $messages, int $options = 0)
+ {
+ }
+
+ /**
+ * Sets the verbosity of the output.
+ *
+ * @param self::VERBOSITY_* $level
+ *
+ * @return void
+ */
+ public function setVerbosity(int $level)
+ {
+ }
+
+ /**
+ * Gets the current verbosity of the output.
+ *
+ * @return self::VERBOSITY_*
+ */
+ public function getVerbosity(): int
+ {
+ }
+
+ /**
+ * Returns whether verbosity is quiet (-q).
+ */
+ public function isQuiet(): bool
+ {
+ }
+
+ /**
+ * Returns whether verbosity is verbose (-v).
+ */
+ public function isVerbose(): bool
+ {
+ }
+
+ /**
+ * Returns whether verbosity is very verbose (-vv).
+ */
+ public function isVeryVerbose(): bool
+ {
+ }
+
+ /**
+ * Returns whether verbosity is debug (-vvv).
+ */
+ public function isDebug(): bool
+ {
+ }
+
+ /**
+ * Sets the decorated flag.
+ *
+ * @return void
+ */
+ public function setDecorated(bool $decorated)
+ {
+ }
+
+ /**
+ * Gets the decorated flag.
+ */
+ public function isDecorated(): bool
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function setFormatter(OutputFormatterInterface $formatter)
+ {
+ }
+
+ /**
+ * Returns current output formatter instance.
+ */
+ public function getFormatter(): OutputFormatterInterface
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_output_streamoutput.php b/tests/stubs/symfony_component_console_output_streamoutput.php
new file mode 100644
index 000000000..492a5d6e9
--- /dev/null
+++ b/tests/stubs/symfony_component_console_output_streamoutput.php
@@ -0,0 +1,76 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * StreamOutput writes the output to a given stream.
+ *
+ * Usage:
+ *
+ * $output = new StreamOutput(fopen('php://stdout', 'w'));
+ *
+ * As `StreamOutput` can use any stream, you can also use a file:
+ *
+ * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
+ *
+ * @author Fabien Potencier
+ */
+class StreamOutput extends Output
+{
+ /**
+ * @param resource $stream A stream resource
+ * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
+ * @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
+ * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
+ *
+ * @throws InvalidArgumentException When first argument is not a real stream
+ */
+ public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null)
+ {
+ }
+
+ /**
+ * Gets the stream attached to this StreamOutput instance.
+ *
+ * @return resource
+ */
+ public function getStream()
+ {
+ }
+
+ /**
+ * @return void
+ */
+ protected function doWrite(string $message, bool $newline)
+ {
+ }
+
+ /**
+ * Returns true if the stream supports colorization.
+ *
+ * Colorization is disabled if not supported by the stream:
+ *
+ * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo
+ * terminals via named pipes, so we can only check the environment.
+ *
+ * Reference: Composer\XdebugHandler\Process::supportsColor
+ * https://github.com/composer/xdebug-handler
+ *
+ * @return bool true if the stream supports colorization, false otherwise
+ */
+ protected function hasColorSupport(): bool
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_question_confirmationquestion.php b/tests/stubs/symfony_component_console_question_confirmationquestion.php
new file mode 100644
index 000000000..0db6fe2fa
--- /dev/null
+++ b/tests/stubs/symfony_component_console_question_confirmationquestion.php
@@ -0,0 +1,29 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Question;
+
+/**
+ * Represents a yes/no question.
+ *
+ * @author Fabien Potencier
+ */
+class ConfirmationQuestion extends Question
+{
+ /**
+ * @param string $question The question to ask to the user
+ * @param bool $default The default answer to return, true or false
+ * @param string $trueAnswerRegex A regex to match the "yes" answer
+ */
+ public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i')
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_console_question_question.php b/tests/stubs/symfony_component_console_question_question.php
new file mode 100644
index 000000000..c04b412b9
--- /dev/null
+++ b/tests/stubs/symfony_component_console_question_question.php
@@ -0,0 +1,207 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Question;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\LogicException;
+
+/**
+ * Represents a Question.
+ *
+ * @author Fabien Potencier
+ */
+class Question
+{
+ /**
+ * @param string $question The question to ask to the user
+ * @param string|bool|int|float|null $default The default answer to return if the user enters nothing
+ */
+ public function __construct(string $question, string|bool|int|float|null $default = null)
+ {
+ }
+
+ /**
+ * Returns the question.
+ */
+ public function getQuestion(): string
+ {
+ }
+
+ /**
+ * Returns the default answer.
+ */
+ public function getDefault(): string|bool|int|float|null
+ {
+ }
+
+ /**
+ * Returns whether the user response accepts newline characters.
+ */
+ public function isMultiline(): bool
+ {
+ }
+
+ /**
+ * Sets whether the user response should accept newline characters.
+ *
+ * @return $this
+ */
+ public function setMultiline(bool $multiline): static
+ {
+ }
+
+ /**
+ * Returns whether the user response must be hidden.
+ */
+ public function isHidden(): bool
+ {
+ }
+
+ /**
+ * Sets whether the user response must be hidden or not.
+ *
+ * @return $this
+ *
+ * @throws LogicException In case the autocompleter is also used
+ */
+ public function setHidden(bool $hidden): static
+ {
+ }
+
+ /**
+ * In case the response cannot be hidden, whether to fallback on non-hidden question or not.
+ */
+ public function isHiddenFallback(): bool
+ {
+ }
+
+ /**
+ * Sets whether to fallback on non-hidden question if the response cannot be hidden.
+ *
+ * @return $this
+ */
+ public function setHiddenFallback(bool $fallback): static
+ {
+ }
+
+ /**
+ * Gets values for the autocompleter.
+ */
+ public function getAutocompleterValues(): ?iterable
+ {
+ }
+
+ /**
+ * Sets values for the autocompleter.
+ *
+ * @return $this
+ *
+ * @throws LogicException
+ */
+ public function setAutocompleterValues(?iterable $values): static
+ {
+ }
+
+ /**
+ * Gets the callback function used for the autocompleter.
+ */
+ public function getAutocompleterCallback(): ?callable
+ {
+ }
+
+ /**
+ * Sets the callback function used for the autocompleter.
+ *
+ * The callback is passed the user input as argument and should return an iterable of corresponding suggestions.
+ *
+ * @return $this
+ */
+ public function setAutocompleterCallback(?callable $callback = null): static
+ {
+ }
+
+ /**
+ * Sets a validator for the question.
+ *
+ * @return $this
+ */
+ public function setValidator(?callable $validator = null): static
+ {
+ }
+
+ /**
+ * Gets the validator for the question.
+ */
+ public function getValidator(): ?callable
+ {
+ }
+
+ /**
+ * Sets the maximum number of attempts.
+ *
+ * Null means an unlimited number of attempts.
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException in case the number of attempts is invalid
+ */
+ public function setMaxAttempts(?int $attempts): static
+ {
+ }
+
+ /**
+ * Gets the maximum number of attempts.
+ *
+ * Null means an unlimited number of attempts.
+ */
+ public function getMaxAttempts(): ?int
+ {
+ }
+
+ /**
+ * Sets a normalizer for the response.
+ *
+ * The normalizer can be a callable (a string), a closure or a class implementing __invoke.
+ *
+ * @return $this
+ */
+ public function setNormalizer(callable $normalizer): static
+ {
+ }
+
+ /**
+ * Gets the normalizer for the response.
+ *
+ * The normalizer can ba a callable (a string), a closure or a class implementing __invoke.
+ */
+ public function getNormalizer(): ?callable
+ {
+ }
+
+ /**
+ * @return bool
+ */
+ protected function isAssoc(array $array)
+ {
+ }
+
+ public function isTrimmable(): bool
+ {
+ }
+
+ /**
+ * @return $this
+ */
+ public function setTrimmable(bool $trimmable): static
+ {
+ }
+}
diff --git a/tests/stubs/symfony_component_process_process.php b/tests/stubs/symfony_component_process_process.php
new file mode 100644
index 000000000..b06f4b939
--- /dev/null
+++ b/tests/stubs/symfony_component_process_process.php
@@ -0,0 +1,773 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Process;
+
+use Symfony\Component\Process\Exception\InvalidArgumentException;
+use Symfony\Component\Process\Exception\LogicException;
+use Symfony\Component\Process\Exception\ProcessFailedException;
+use Symfony\Component\Process\Exception\ProcessSignaledException;
+use Symfony\Component\Process\Exception\ProcessTimedOutException;
+use Symfony\Component\Process\Exception\RuntimeException;
+use Symfony\Component\Process\Pipes\UnixPipes;
+use Symfony\Component\Process\Pipes\WindowsPipes;
+
+/**
+ * Process is a thin wrapper around proc_* functions to easily
+ * start independent PHP processes.
+ *
+ * @author Fabien Potencier
+ * @author Romain Neutron
+ *
+ * @implements \IteratorAggregate
+ */
+class Process implements \IteratorAggregate
+{
+ public const ERR = 'err';
+ public const OUT = 'out';
+
+ public const STATUS_READY = 'ready';
+ public const STATUS_STARTED = 'started';
+ public const STATUS_TERMINATED = 'terminated';
+
+ public const STDIN = 0;
+ public const STDOUT = 1;
+ public const STDERR = 2;
+
+ // Timeout Precision in seconds.
+ public const TIMEOUT_PRECISION = 0.2;
+
+ public const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking
+ public const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory
+ public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating
+ public const ITER_SKIP_ERR = 8;
+
+ /**
+ * Exit codes translation table.
+ *
+ * User-defined errors must use exit codes in the 64-113 range.
+ */
+ public static $exitCodes = [
+ 0 => 'OK',
+ 1 => 'General error',
+ 2 => 'Misuse of shell builtins',
+
+ 126 => 'Invoked command cannot execute',
+ 127 => 'Command not found',
+ 128 => 'Invalid exit argument',
+
+ // signals
+ 129 => 'Hangup',
+ 130 => 'Interrupt',
+ 131 => 'Quit and dump core',
+ 132 => 'Illegal instruction',
+ 133 => 'Trace/breakpoint trap',
+ 134 => 'Process aborted',
+ 135 => 'Bus error: "access to undefined portion of memory object"',
+ 136 => 'Floating point exception: "erroneous arithmetic operation"',
+ 137 => 'Kill (terminate immediately)',
+ 138 => 'User-defined 1',
+ 139 => 'Segmentation violation',
+ 140 => 'User-defined 2',
+ 141 => 'Write to pipe with no one reading',
+ 142 => 'Signal raised by alarm',
+ 143 => 'Termination (request to terminate)',
+ // 144 - not defined
+ 145 => 'Child process terminated, stopped (or continued*)',
+ 146 => 'Continue if stopped',
+ 147 => 'Stop executing temporarily',
+ 148 => 'Terminal stop signal',
+ 149 => 'Background process attempting to read from tty ("in")',
+ 150 => 'Background process attempting to write to tty ("out")',
+ 151 => 'Urgent data available on socket',
+ 152 => 'CPU time limit exceeded',
+ 153 => 'File size limit exceeded',
+ 154 => 'Signal raised by timer counting virtual time: "virtual timer expired"',
+ 155 => 'Profiling timer expired',
+ // 156 - not defined
+ 157 => 'Pollable event',
+ // 158 - not defined
+ 159 => 'Bad syscall',
+ ];
+
+ /**
+ * @param array $command The command to run and its arguments listed as separate entries
+ * @param string|null $cwd The working directory or null to use the working dir of the current PHP process
+ * @param array|null $env The environment variables or null to use the same environment as the current PHP process
+ * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input
+ * @param int|float|null $timeout The timeout in seconds or null to disable
+ *
+ * @throws LogicException When proc_open is not installed
+ */
+ public function __construct(array $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60)
+ {
+ }
+
+ /**
+ * Creates a Process instance as a command-line to be run in a shell wrapper.
+ *
+ * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.)
+ * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the
+ * shell wrapper and not to your commands.
+ *
+ * In order to inject dynamic values into command-lines, we strongly recommend using placeholders.
+ * This will save escaping values, which is not portable nor secure anyway:
+ *
+ * $process = Process::fromShellCommandline('my_command "${:MY_VAR}"');
+ * $process->run(null, ['MY_VAR' => $theValue]);
+ *
+ * @param string $command The command line to pass to the shell of the OS
+ * @param string|null $cwd The working directory or null to use the working dir of the current PHP process
+ * @param array|null $env The environment variables or null to use the same environment as the current PHP process
+ * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input
+ * @param int|float|null $timeout The timeout in seconds or null to disable
+ *
+ * @throws LogicException When proc_open is not installed
+ */
+ public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static
+ {
+ }
+
+ public function __sleep(): array
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function __wakeup()
+ {
+ }
+
+ public function __destruct()
+ {
+ }
+
+ public function __clone()
+ {
+ }
+
+ /**
+ * Runs the process.
+ *
+ * The callback receives the type of output (out or err) and
+ * some bytes from the output in real-time. It allows to have feedback
+ * from the independent process during execution.
+ *
+ * The STDOUT and STDERR are also available after the process is finished
+ * via the getOutput() and getErrorOutput() methods.
+ *
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
+ *
+ * @return int The exit status code
+ *
+ * @throws RuntimeException When process can't be launched
+ * @throws RuntimeException When process is already running
+ * @throws ProcessTimedOutException When process timed out
+ * @throws ProcessSignaledException When process stopped after receiving signal
+ * @throws LogicException In case a callback is provided and output has been disabled
+ *
+ * @final
+ */
+ public function run(?callable $callback = null, array $env = []): int
+ {
+ }
+
+ /**
+ * Runs the process.
+ *
+ * This is identical to run() except that an exception is thrown if the process
+ * exits with a non-zero exit code.
+ *
+ * @return $this
+ *
+ * @throws ProcessFailedException if the process didn't terminate successfully
+ *
+ * @final
+ */
+ public function mustRun(?callable $callback = null, array $env = []): static
+ {
+ }
+
+ /**
+ * Starts the process and returns after writing the input to STDIN.
+ *
+ * This method blocks until all STDIN data is sent to the process then it
+ * returns while the process runs in the background.
+ *
+ * The termination of the process can be awaited with wait().
+ *
+ * The callback receives the type of output (out or err) and some bytes from
+ * the output in real-time while writing the standard input to the process.
+ * It allows to have feedback from the independent process during execution.
+ *
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
+ *
+ * @return void
+ *
+ * @throws RuntimeException When process can't be launched
+ * @throws RuntimeException When process is already running
+ * @throws LogicException In case a callback is provided and output has been disabled
+ */
+ public function start(?callable $callback = null, array $env = [])
+ {
+ }
+
+ /**
+ * Restarts the process.
+ *
+ * Be warned that the process is cloned before being started.
+ *
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
+ *
+ * @throws RuntimeException When process can't be launched
+ * @throws RuntimeException When process is already running
+ *
+ * @see start()
+ *
+ * @final
+ */
+ public function restart(?callable $callback = null, array $env = []): static
+ {
+ }
+
+ /**
+ * Waits for the process to terminate.
+ *
+ * The callback receives the type of output (out or err) and some bytes
+ * from the output in real-time while writing the standard input to the process.
+ * It allows to have feedback from the independent process during execution.
+ *
+ * @param callable|null $callback A valid PHP callback
+ *
+ * @return int The exitcode of the process
+ *
+ * @throws ProcessTimedOutException When process timed out
+ * @throws ProcessSignaledException When process stopped after receiving signal
+ * @throws LogicException When process is not yet started
+ */
+ public function wait(?callable $callback = null): int
+ {
+ }
+
+ /**
+ * Waits until the callback returns true.
+ *
+ * The callback receives the type of output (out or err) and some bytes
+ * from the output in real-time while writing the standard input to the process.
+ * It allows to have feedback from the independent process during execution.
+ *
+ * @throws RuntimeException When process timed out
+ * @throws LogicException When process is not yet started
+ * @throws ProcessTimedOutException In case the timeout was reached
+ */
+ public function waitUntil(callable $callback): bool
+ {
+ }
+
+ /**
+ * Returns the Pid (process identifier), if applicable.
+ *
+ * @return int|null The process id if running, null otherwise
+ */
+ public function getPid(): ?int
+ {
+ }
+
+ /**
+ * Sends a POSIX signal to the process.
+ *
+ * @param int $signal A valid POSIX signal (see https://php.net/pcntl.constants)
+ *
+ * @return $this
+ *
+ * @throws LogicException In case the process is not running
+ * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed
+ * @throws RuntimeException In case of failure
+ */
+ public function signal(int $signal): static
+ {
+ }
+
+ /**
+ * Disables fetching output and error output from the underlying process.
+ *
+ * @return $this
+ *
+ * @throws RuntimeException In case the process is already running
+ * @throws LogicException if an idle timeout is set
+ */
+ public function disableOutput(): static
+ {
+ }
+
+ /**
+ * Enables fetching output and error output from the underlying process.
+ *
+ * @return $this
+ *
+ * @throws RuntimeException In case the process is already running
+ */
+ public function enableOutput(): static
+ {
+ }
+
+ /**
+ * Returns true in case the output is disabled, false otherwise.
+ */
+ public function isOutputDisabled(): bool
+ {
+ }
+
+ /**
+ * Returns the current output of the process (STDOUT).
+ *
+ * @throws LogicException in case the output has been disabled
+ * @throws LogicException In case the process is not started
+ */
+ public function getOutput(): string
+ {
+ }
+
+ /**
+ * Returns the output incrementally.
+ *
+ * In comparison with the getOutput method which always return the whole
+ * output, this one returns the new output since the last call.
+ *
+ * @throws LogicException in case the output has been disabled
+ * @throws LogicException In case the process is not started
+ */
+ public function getIncrementalOutput(): string
+ {
+ }
+
+ /**
+ * Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR).
+ *
+ * @param int $flags A bit field of Process::ITER_* flags
+ *
+ * @return \Generator
+ *
+ * @throws LogicException in case the output has been disabled
+ * @throws LogicException In case the process is not started
+ */
+ public function getIterator(int $flags = 0): \Generator
+ {
+ }
+
+ /**
+ * Clears the process output.
+ *
+ * @return $this
+ */
+ public function clearOutput(): static
+ {
+ }
+
+ /**
+ * Returns the current error output of the process (STDERR).
+ *
+ * @throws LogicException in case the output has been disabled
+ * @throws LogicException In case the process is not started
+ */
+ public function getErrorOutput(): string
+ {
+ }
+
+ /**
+ * Returns the errorOutput incrementally.
+ *
+ * In comparison with the getErrorOutput method which always return the
+ * whole error output, this one returns the new error output since the last
+ * call.
+ *
+ * @throws LogicException in case the output has been disabled
+ * @throws LogicException In case the process is not started
+ */
+ public function getIncrementalErrorOutput(): string
+ {
+ }
+
+ /**
+ * Clears the process output.
+ *
+ * @return $this
+ */
+ public function clearErrorOutput(): static
+ {
+ }
+
+ /**
+ * Returns the exit code returned by the process.
+ *
+ * @return int|null The exit status code, null if the Process is not terminated
+ */
+ public function getExitCode(): ?int
+ {
+ }
+
+ /**
+ * Returns a string representation for the exit code returned by the process.
+ *
+ * This method relies on the Unix exit code status standardization
+ * and might not be relevant for other operating systems.
+ *
+ * @return string|null A string representation for the exit status code, null if the Process is not terminated
+ *
+ * @see http://tldp.org/LDP/abs/html/exitcodes.html
+ * @see http://en.wikipedia.org/wiki/Unix_signal
+ */
+ public function getExitCodeText(): ?string
+ {
+ }
+
+ /**
+ * Checks if the process ended successfully.
+ */
+ public function isSuccessful(): bool
+ {
+ }
+
+ /**
+ * Returns true if the child process has been terminated by an uncaught signal.
+ *
+ * It always returns false on Windows.
+ *
+ * @throws LogicException In case the process is not terminated
+ */
+ public function hasBeenSignaled(): bool
+ {
+ }
+
+ /**
+ * Returns the number of the signal that caused the child process to terminate its execution.
+ *
+ * It is only meaningful if hasBeenSignaled() returns true.
+ *
+ * @throws RuntimeException In case --enable-sigchild is activated
+ * @throws LogicException In case the process is not terminated
+ */
+ public function getTermSignal(): int
+ {
+ }
+
+ /**
+ * Returns true if the child process has been stopped by a signal.
+ *
+ * It always returns false on Windows.
+ *
+ * @throws LogicException In case the process is not terminated
+ */
+ public function hasBeenStopped(): bool
+ {
+ }
+
+ /**
+ * Returns the number of the signal that caused the child process to stop its execution.
+ *
+ * It is only meaningful if hasBeenStopped() returns true.
+ *
+ * @throws LogicException In case the process is not terminated
+ */
+ public function getStopSignal(): int
+ {
+ }
+
+ /**
+ * Checks if the process is currently running.
+ */
+ public function isRunning(): bool
+ {
+ }
+
+ /**
+ * Checks if the process has been started with no regard to the current state.
+ */
+ public function isStarted(): bool
+ {
+ }
+
+ /**
+ * Checks if the process is terminated.
+ */
+ public function isTerminated(): bool
+ {
+ }
+
+ /**
+ * Gets the process status.
+ *
+ * The status is one of: ready, started, terminated.
+ */
+ public function getStatus(): string
+ {
+ }
+
+ /**
+ * Stops the process.
+ *
+ * @param int|float $timeout The timeout in seconds
+ * @param int|null $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9)
+ *
+ * @return int|null The exit-code of the process or null if it's not running
+ */
+ public function stop(float $timeout = 10, ?int $signal = null): ?int
+ {
+ }
+
+ /**
+ * Adds a line to the STDOUT stream.
+ *
+ * @internal
+ */
+ public function addOutput(string $line): void
+ {
+ }
+
+ /**
+ * Adds a line to the STDERR stream.
+ *
+ * @internal
+ */
+ public function addErrorOutput(string $line): void
+ {
+ }
+
+ /**
+ * Gets the last output time in seconds.
+ */
+ public function getLastOutputTime(): ?float
+ {
+ }
+
+ /**
+ * Gets the command line to be executed.
+ */
+ public function getCommandLine(): string
+ {
+ }
+
+ /**
+ * Gets the process timeout in seconds (max. runtime).
+ */
+ public function getTimeout(): ?float
+ {
+ }
+
+ /**
+ * Gets the process idle timeout in seconds (max. time since last output).
+ */
+ public function getIdleTimeout(): ?float
+ {
+ }
+
+ /**
+ * Sets the process timeout (max. runtime) in seconds.
+ *
+ * To disable the timeout, set this value to null.
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException if the timeout is negative
+ */
+ public function setTimeout(?float $timeout): static
+ {
+ }
+
+ /**
+ * Sets the process idle timeout (max. time since last output) in seconds.
+ *
+ * To disable the timeout, set this value to null.
+ *
+ * @return $this
+ *
+ * @throws LogicException if the output is disabled
+ * @throws InvalidArgumentException if the timeout is negative
+ */
+ public function setIdleTimeout(?float $timeout): static
+ {
+ }
+
+ /**
+ * Enables or disables the TTY mode.
+ *
+ * @return $this
+ *
+ * @throws RuntimeException In case the TTY mode is not supported
+ */
+ public function setTty(bool $tty): static
+ {
+ }
+
+ /**
+ * Checks if the TTY mode is enabled.
+ */
+ public function isTty(): bool
+ {
+ }
+
+ /**
+ * Sets PTY mode.
+ *
+ * @return $this
+ */
+ public function setPty(bool $bool): static
+ {
+ }
+
+ /**
+ * Returns PTY state.
+ */
+ public function isPty(): bool
+ {
+ }
+
+ /**
+ * Gets the working directory.
+ */
+ public function getWorkingDirectory(): ?string
+ {
+ }
+
+ /**
+ * Sets the current working directory.
+ *
+ * @return $this
+ */
+ public function setWorkingDirectory(string $cwd): static
+ {
+ }
+
+ /**
+ * Gets the environment variables.
+ */
+ public function getEnv(): array
+ {
+ }
+
+ /**
+ * Sets the environment variables.
+ *
+ * @param array $env The new environment variables
+ *
+ * @return $this
+ */
+ public function setEnv(array $env): static
+ {
+ }
+
+ /**
+ * Gets the Process input.
+ *
+ * @return resource|string|\Iterator|null
+ */
+ public function getInput()
+ {
+ }
+
+ /**
+ * Sets the input.
+ *
+ * This content will be passed to the underlying process standard input.
+ *
+ * @param string|resource|\Traversable|self|null $input The content
+ *
+ * @return $this
+ *
+ * @throws LogicException In case the process is running
+ */
+ public function setInput(mixed $input): static
+ {
+ }
+
+ /**
+ * Performs a check between the timeout definition and the time the process started.
+ *
+ * In case you run a background process (with the start method), you should
+ * trigger this method regularly to ensure the process timeout
+ *
+ * @return void
+ *
+ * @throws ProcessTimedOutException In case the timeout was reached
+ */
+ public function checkTimeout()
+ {
+ }
+
+ /**
+ * @throws LogicException in case process is not started
+ */
+ public function getStartTime(): float
+ {
+ }
+
+ /**
+ * Defines options to pass to the underlying proc_open().
+ *
+ * @see https://php.net/proc_open for the options supported by PHP.
+ *
+ * Enabling the "create_new_console" option allows a subprocess to continue
+ * to run after the main process exited, on both Windows and *nix
+ *
+ * @return void
+ */
+ public function setOptions(array $options)
+ {
+ }
+
+ /**
+ * Returns whether TTY is supported on the current operating system.
+ */
+ public static function isTtySupported(): bool
+ {
+ }
+
+ /**
+ * Returns whether PTY is supported on the current operating system.
+ */
+ public static function isPtySupported(): bool
+ {
+ }
+
+ /**
+ * Builds up the callback used by wait().
+ *
+ * The callbacks adds all occurred output to the specific buffer and calls
+ * the user callback (if present) with the received output.
+ *
+ * @param callable|null $callback The user defined PHP callback
+ */
+ protected function buildCallback(?callable $callback = null): \Closure
+ {
+ }
+
+ /**
+ * Updates the status of the process, reads pipes.
+ *
+ * @param bool $blocking Whether to use a blocking read call
+ *
+ * @return void
+ */
+ protected function updateStatus(bool $blocking)
+ {
+ }
+
+ /**
+ * Returns whether PHP has been compiled with the '--enable-sigchild' option or not.
+ */
+ protected function isSigchildEnabled(): bool
+ {
+ }
+}